Skip to content
Snippets Groups Projects
Commit 72541ac9 authored by Dominik Taborsky's avatar Dominik Taborsky
Browse files

zone_update: clear right after commit, delete original zone after full update

parent dcfba7c5
Branches
Tags
No related merge requests found
......@@ -153,6 +153,7 @@ static int process_normal(conf_t *conf, zone_t *zone, list_t *requests)
// Apply changes.
ret = zone_update_commit(conf, &up);
zone_update_clear(&up);
if (ret != KNOT_EOK) {
if (ret == KNOT_ETTL || ret == KNOT_EZONESIZE) {
set_rcodes(requests, KNOT_RCODE_REFUSED);
......@@ -162,8 +163,6 @@ static int process_normal(conf_t *conf, zone_t *zone, list_t *requests)
return ret;
}
zone_update_clear(&up);
/* Sync zonefile immediately if configured. */
conf_val_t val = conf_zone_get(conf, C_ZONEFILE_SYNC, zone->name);
if (conf_int(&val) == 0) {
......
......@@ -716,6 +716,7 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
/* Sync RCU. */
synchronize_rcu();
if (update->flags & UPDATE_FULL) {
zone_contents_deep_free(&old_contents);
update->new_cont = NULL;
} else if (update->flags & UPDATE_INCREMENTAL) {
update_cleanup(&update->a_ctx);
......
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