Add endpoint check
This commit is contained in:
parent
1be560f69c
commit
8ba1230610
2 changed files with 8 additions and 1 deletions
|
@ -453,7 +453,13 @@ node * _r3_tree_insert_pathl(node *tree, char *path, int path_len, route * route
|
||||||
if ( subpath_len > 0 ) {
|
if ( subpath_len > 0 ) {
|
||||||
return _r3_tree_insert_pathl(e->child, subpath, subpath_len, route, data);
|
return _r3_tree_insert_pathl(e->child, subpath, subpath_len, route, data);
|
||||||
} else {
|
} else {
|
||||||
// no more path to insert
|
// there are no more path to insert
|
||||||
|
|
||||||
|
// see if there is an endpoint already
|
||||||
|
if (e->child->endpoint) {
|
||||||
|
// XXX: return an error code instead of NULL
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
e->child->endpoint++; // make it as an endpoint
|
e->child->endpoint++; // make it as an endpoint
|
||||||
e->child->data = data;
|
e->child->data = data;
|
||||||
if (route) {
|
if (route) {
|
||||||
|
|
|
@ -328,3 +328,4 @@
|
||||||
1400466833,13166545.46
|
1400466833,13166545.46
|
||||||
1400466875,13515485.94
|
1400466875,13515485.94
|
||||||
1400467139,13047096.38
|
1400467139,13047096.38
|
||||||
|
1400467481,13594764.91
|
||||||
|
|
|
Loading…
Reference in a new issue