c9s / r3

libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
http://c9s.github.com/r3/bench.html
MIT License
813 stars 83 forks source link

Can't match root uri "/" #85

Closed coney closed 8 years ago

coney commented 8 years ago

It's ok to insert a new route for "/".

but when I try to match uri "/", r3 told me that nothing matched.

c9s commented 8 years ago

Could you call r3_tree_dump and paste the dumped tree structure ? Thanks

c9s commented 8 years ago

Please see 5f39b7321124f98a369110c7f0922c6cd0db11bd I added a test case for it, and it passes

coney commented 8 years ago

I have sent a pull request for this case: https://github.com/c9s/r3/pull/86

the root uri "/" will fail if it was added by r3_tree_insert_route

check_tree.c:738:F:testcase:test_insert_route:0: Assertion 'r != ((void*)0)' failed

c9s commented 8 years ago

Fixed on master