Open hongzhidao opened 5 years ago
@VBart
diff -r 991ab50a9dbd src/nxt_http_route.c
--- a/src/nxt_http_route.c Fri Nov 08 07:19:32 2019 +0800
+++ b/src/nxt_http_route.c Sat Nov 09 11:11:49 2019 +0800
@@ -369,7 +369,7 @@
match_conf = nxt_conf_get_path(cv, &match_path);
n = (match_conf != NULL) ? nxt_conf_object_members_count(match_conf) : 0;
- size = sizeof(nxt_http_route_match_t) + n * sizeof(nxt_http_route_rule_t *);
+ size = sizeof(nxt_http_route_match_t) + n * sizeof(nxt_http_route_test_t *);
mp = tmcf->router_conf->mem_pool;
Though the size of nxt_http_route_rule_t is equal to the size of nxt_http_route_test_t. But the type of test field is nxt_http_route_test_t[].
typedef union {
nxt_http_route_rule_t *rule;
nxt_http_route_table_t *table;
} nxt_http_route_test_t;
typedef struct {
uint32_t items;
nxt_http_pass_t pass;
nxt_http_route_test_t test[0];
} nxt_http_route_match_t;
Hi, I did a bit rework.