-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add route test for r3_tree_insert_route #86
Conversation
coney
commented
Oct 18, 2015
Try put the shortest path at first position? |
it works well if i put the but this limitation is a bit annoying. is it easy to fix(or improve) it? |
Yeah, you can fix that in r3_tree_insert_*, I think for existing node (root) should increase the mount_point by one. |
Might be caused from here: https://github.com/c9s/r3/blob/master/src/node.c#L734 Does your insert function return value? |
sorry, i'm too busy these day, i will try it later |
I'm using route * r = r3_tree_insert_routel_ex((node*)tree, method,
path, strlen(path), data, errstr);
printf("insert %s(data:%p) return %p\n", path, data, r); when i insert
dumped tree looks like this:
|
If i put
and the dump
|
I don't understand. match which path? |
|
If you're using greedy pattern in the middle for different routes, please see this issue: |
|
still can not match which path? the root |
yes, can't match the root uri, the rests are good |
Another suspicion:
Route matching require node's endpoint > 0 |
this PR simulates the problem, I add a new test case |
Sorry I won't merge this until it has a fix, and I am too busy right now to fix this issue. |
putting the |
Fixed on master |