perf: 重构优化路由性能,添加日志系统,优化大文件内存占用,加强输入验证及路径安全等

This commit is contained in:
meiseayoung
2025-12-26 13:46:25 +08:00
parent f722370cf3
commit 3355e274e2
67 changed files with 18527 additions and 963 deletions
+3 -3
View File
@@ -145,16 +145,16 @@ fn (tr ContextTrieRouter) collect_routes(node &ContextTrieNode, current_path str
// 收集静态子节点
for segment, child in node.children {
tr.collect_routes(child, current_path + '/' + segment, mut routes)
tr.collect_routes(child, '${current_path}/${segment}', mut routes)
}
// 收集参数子节点
if node.param_child != unsafe { nil } {
tr.collect_routes(node.param_child, current_path + '/:' + node.param_child.param_name, mut routes)
tr.collect_routes(node.param_child, '${current_path}/:${node.param_child.param_name}', mut routes)
}
// 收集通配符子节点
if node.wildcard_child != unsafe { nil } {
tr.collect_routes(node.wildcard_child, current_path + '/*', mut routes)
tr.collect_routes(node.wildcard_child, '${current_path}/*', mut routes)
}
}