Commit 72461c6f authored by Lubos Slovak's avatar Lubos Slovak

Fixes in node removing.

- Turned on new changeset applying.
- Fixed selecting nodes for removing (only those without RRSets
  and without children).
- Separated selecting and deleting nodes into a function.

refs #1550 @2h
parent 7faaeef6
......@@ -1113,7 +1113,7 @@ static int zones_journal_apply(knot_zone_t *zone)
log_server_info("Applying '%zu' changesets from journal "
"to zone '%s'.\n",
chsets->count, zd->conf->name);
int apply_ret = xfrin_apply_changesets_to_zone(zone, chsets);
int apply_ret = xfrin_apply_changesets(zone, chsets);
if (apply_ret != KNOT_EOK) {
log_server_error("Failed to apply changesets to "
"'%s' - %s\n",
......@@ -2609,8 +2609,8 @@ int zones_apply_changesets(knot_ns_xfr_t *xfr)
return KNOTD_EINVAL;
}
return xfrin_apply_changesets_to_zone(xfr->zone,
(knot_changesets_t *)xfr->data);
return xfrin_apply_changesets(xfr->zone,
(knot_changesets_t *)xfr->data);
}
/*----------------------------------------------------------------------------*/
......
This diff is collapsed.
......@@ -181,6 +181,9 @@ int xfrin_process_ixfr_packet(knot_ns_xfr_t *xfr/*const uint8_t *pkt, size_t siz
int xfrin_apply_changesets_to_zone(knot_zone_t *zone,
knot_changesets_t *chsets);
int xfrin_apply_changesets(knot_zone_t *zone,
knot_changesets_t *chsets);
#endif /* _KNOTXFR_IN_H_ */
/*! @} */
......@@ -57,10 +57,10 @@
//#define KNOT_NSEC3_DEBUG
//#define CUCKOO_DEBUG
//#define CUCKOO_DEBUG_HASH
#define KNOT_NS_DEBUG
//#define KNOT_XFRIN_DEBUG
//#define KNOT_NS_DEBUG
#define KNOT_XFRIN_DEBUG
//#define KNOT_DDNS_DEBUG
#define KNOT_TSIG_DEBUG
//#define KNOT_TSIG_DEBUG
/*!
* \brief Dumps RDATA of the given type.
......
......@@ -1454,6 +1454,10 @@ int knot_zone_contents_remove_node(knot_zone_contents_t *contents,
const knot_dname_t *owner = knot_node_owner(node);
char *name = knot_dname_to_str(owner);
fprintf(stderr, "Removing zone node: %s\n", name);
free(name);
// 1) remove the node from hash table
*removed_hash = NULL;
*removed_hash = ck_remove_item(contents->table,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment