From 36198aefba8756cb03f87e23828079b909600ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=87?= Date: Sun, 15 Dec 2019 13:05:49 +0800 Subject: [PATCH] bugfix: insert path success, but get data failed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/node.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node.c b/src/node.c index 6f4fa0c..514c669 100644 --- a/src/node.c +++ b/src/node.c @@ -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; }