diff options
Diffstat (limited to 'src/libknot/zone/zone-tree.c')
-rw-r--r-- | src/libknot/zone/zone-tree.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/libknot/zone/zone-tree.c b/src/libknot/zone/zone-tree.c index de5df18..2b79f86 100644 --- a/src/libknot/zone/zone-tree.c +++ b/src/libknot/zone/zone-tree.c @@ -318,6 +318,24 @@ int knot_zone_tree_get_less_or_equal(knot_zone_tree_t *tree, *found = (exact_match > 0) ? f->node : NULL; +dbg_zone_exec_detail( + char *name = knot_dname_to_str(owner); + char *name_f = (f != NULL) + ? knot_dname_to_str(knot_node_owner(f->node)) + : "none"; + + dbg_zone_detail("Searched for owner %s in zone tree.\n", + name); + dbg_zone_detail("Exact match: %d\n", exact_match); + dbg_zone_detail("Found node: %p: %s.\n", f, name_f); + dbg_zone_detail("Previous node: %p.\n", prev); + + free(name); + if (f != NULL) { + free(name_f); + } +); + if (exact_match < 0) { // previous is not really previous but should be the leftmost // node in the tree; take it's previous @@ -325,18 +343,6 @@ int knot_zone_tree_get_less_or_equal(knot_zone_tree_t *tree, *previous = knot_node_get_previous(prev->node); exact_match = 0; } else if (prev == NULL) { - if (!exact_match) { - printf("Searched for owner %s in zone tree.\n", - knot_dname_to_str(owner)); - printf("Exact match: %d\n", exact_match); - printf("Found node: %p: %s.\n", f, (f) - ? knot_dname_to_str(knot_node_owner(f->node)) - : "none"); - printf("Previous node: %p: %s.\n", prev, (prev) - ? knot_dname_to_str(knot_node_owner(prev->node)) - : "none"); - } - // either the returned node is the root of the tree, or // it is the leftmost node in the tree; in both cases // node was found set the previous node of the found |