bugfix: insert path success, but get data failed

background : use  r3_tree_insert_pathl_ex to add path,A : abcdefg   B:abc
When the node A already exists, we set B, then  will split the node and make a branch, suboath_len  is 0 
In this case,  branch a  zero len subpath, which tree's data not set
This commit is contained in:
董宇 2019-12-15 13:05:49 +08:00 committed by GitHub
parent e20e48a5ce
commit 36198aefba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -690,6 +690,7 @@ R3Node * r3_tree_insert_pathl_ex(R3Node *tree, const char *path, unsigned int pa
r3_node_append_route(tree, path, path_len, method, data);
info("tree router path is: %s, with len: %d\n", path, path_len);
}
tree->data = data;
return tree;
}