diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-09 16:41:44 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-09 16:41:44 +0200 |
commit | 4f576eefe3cfa72101fac551dd0e11cc9d5122d4 (patch) | |
tree | b0960e95d97f5ef66946836ccdba24862e995c6e | |
parent | 6f873ac382cee705378972332c6f8eac4f166e3d (diff) | |
download | vmod-tbf-4f576eefe3cfa72101fac551dd0e11cc9d5122d4.tar.gz vmod-tbf-4f576eefe3cfa72101fac551dd0e11cc9d5122d4.tar.bz2 |
Bugfixes
* src/tbf.c (new_node): Reset busy flag.
(log_node): Fix specifiers.
Increase tc->num.
-rw-r--r-- | src/tbf.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -644,12 +644,13 @@ new_node(struct node **nodes, struct dump_header *hdr, | |||
644 | child = nodes[ord]; | 644 | child = nodes[ord]; |
645 | child->parent = parent; | 645 | child->parent = parent; |
646 | } else { | 646 | } else { |
647 | static uint8_t null_key[SHA256_LEN]; | 647 | static uint8_t null_key[SHA256_LEN]; |
648 | 648 | ||
649 | child = node_alloc(null_key, parent); | 649 | child = node_alloc(null_key, parent); |
650 | child->busy = 0; | ||
650 | nodes[ord] = child; | 651 | nodes[ord] = child; |
651 | } | 652 | } |
652 | return child; | 653 | return child; |
653 | } | 654 | } |
654 | 655 | ||
655 | int | 656 | int |
@@ -1005,21 +1006,22 @@ static void | |||
1005 | log_node(struct node *node, void *data) | 1006 | log_node(struct node *node, void *data) |
1006 | { | 1007 | { |
1007 | struct traverse_closure *tc = data; | 1008 | struct traverse_closure *tc = data; |
1008 | char kbuf[2*SHA256_LEN+1]; | 1009 | char kbuf[2*SHA256_LEN+1]; |
1009 | key_to_str(node->key, kbuf); | 1010 | key_to_str(node->key, kbuf); |
1010 | #ifdef DEBUG | 1011 | #ifdef DEBUG |
1011 | syslog(tc->prio, "%d: %p(%p,%p): %"PRIu32" %s: %s", tc->num, node, | 1012 | syslog(tc->prio, "%"PRIu32": %p(%p,%p): %"PRIu32" %s: %s", tc->num, node, |
1012 | node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord, | 1013 | node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord, |
1013 | kbuf, | 1014 | kbuf, |
1014 | node->keystr); | 1015 | node->keystr); |
1015 | #else | 1016 | #else |
1016 | syslog(tc->prio, "%d: %p(%p,%p): %"PRIu32" %s", tc->num, node, | 1017 | syslog(tc->prio, "%"PRIu32": %p(%p,%p): %"PRIu32" %s", tc->num, node, |
1017 | node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord, | 1018 | node->child[CHILD_LEFT], node->child[CHILD_RIGHT], node->ord, |
1018 | kbuf); | 1019 | kbuf); |
1019 | #endif | 1020 | #endif |
1021 | ++tc->num; | ||
1020 | } | 1022 | } |
1021 | 1023 | ||
1022 | 1024 | ||
1023 | VCL_VOID | 1025 | VCL_VOID |
1024 | vmod_log_tree(MOD_CTX ctx, VCL_INT prio) | 1026 | vmod_log_tree(MOD_CTX ctx, VCL_INT prio) |
1025 | { | 1027 | { |