Commit 80abd749 authored by Daniel Salzman's avatar Daniel Salzman

refresh: don't store zone to journal if not configured

parent bce54d00
......@@ -247,11 +247,14 @@ static int axfr_finalize(struct refresh_data *data)
return ret;
}
ret = zone_in_journal_store(data->conf, data->zone, new_zone);
if (ret != KNOT_EOK && ret != KNOT_ENOTSUP) {
IXFRIN_LOG(LOG_WARNING, data->zone->name, data->remote,
"failed to write zone contents to journal (%s)",
knot_strerror(ret));
conf_val_t val = conf_zone_get(data->conf, C_ZONE_IN_JOURNAL, data->zone->name);
if (conf_bool(&val)) {
ret = zone_in_journal_store(data->conf, data->zone, new_zone);
if (ret != KNOT_EOK && ret != KNOT_ENOTSUP) {
IXFRIN_LOG(LOG_WARNING, data->zone->name, data->remote,
"failed to write zone contents to journal (%s)",
knot_strerror(ret));
}
}
zone_contents_t *old_zone = zone_switch_contents(data->zone, new_zone);
......@@ -259,7 +262,6 @@ static int axfr_finalize(struct refresh_data *data)
data->axfr.zone = NULL; // seized
callrcu_wrapper(old_zone, (void (*)(void **))zone_contents_deep_free);
return KNOT_EOK;
}
......
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