Commit df057ef2 authored by Jan Kadlec's avatar Jan Kadlec

changeset: Renaming, doxygen.

parent ec5346f4
......@@ -362,14 +362,14 @@ static int ixfrin_finalize(struct answer_data *adata)
IXFRIN_LOG(LOG_ERR, "Failed to apply changes to zone - %s",
knot_strerror(ret));
updates_rollback(&ixfr->changesets);
update_free_old_zone(&new_contents);
update_free_zone(&new_contents);
return ret;
}
/* Switch zone contents. */
zone_contents_t *old_contents = zone_switch_contents(ixfr->zone, new_contents);
synchronize_rcu();
update_free_old_zone(&old_contents);
update_free_zone(&old_contents);
updates_cleanup(&ixfr->changesets);
......
......@@ -181,7 +181,7 @@ static int process_authenticated(uint16_t *rcode, struct query_data *qdata)
&sec_ch);
if (ret != KNOT_EOK) {
update_rollback(&ddns_ch);
update_free_old_zone(&new_contents);
update_free_zone(&new_contents);
changeset_clear(&ddns_ch);
changeset_clear(&sec_ch);
*rcode = KNOT_RCODE_SERVFAIL;
......@@ -193,7 +193,7 @@ static int process_authenticated(uint16_t *rcode, struct query_data *qdata)
ret = zone_change_store(zone, &ddns_ch);
if (ret != KNOT_EOK) {
update_rollback(&ddns_ch);
update_free_old_zone(&new_contents);
update_free_zone(&new_contents);
changeset_clear(&ddns_ch);
if (zone->conf->dnssec_enable) {
changeset_clear(&sec_ch);
......@@ -213,7 +213,7 @@ static int process_authenticated(uint16_t *rcode, struct query_data *qdata)
}
// Clear obsolete zone contents
update_free_old_zone(&old_contents);
update_free_zone(&old_contents);
update_cleanup(&ddns_ch);
changeset_clear(&ddns_ch);
......
......@@ -485,7 +485,7 @@ int apply_changesets(zone_t *zone, list_t *chsets, zone_contents_t **new_content
ret = apply_single(contents_copy, set, master);
if (ret != KNOT_EOK) {
updates_rollback(chsets);
update_free_old_zone(&contents_copy);
update_free_zone(&contents_copy);
return ret;
}
}
......@@ -495,7 +495,7 @@ int apply_changesets(zone_t *zone, list_t *chsets, zone_contents_t **new_content
ret = finalize_updated_zone(contents_copy, true);
if (ret != KNOT_EOK) {
updates_rollback(chsets);
update_free_old_zone(&contents_copy);
update_free_zone(&contents_copy);
return ret;
}
......@@ -525,14 +525,14 @@ int apply_changeset(zone_t *zone, changeset_t *change, zone_contents_t **new_con
ret = apply_single(contents_copy, change, master);
if (ret != KNOT_EOK) {
update_rollback(change);
update_free_old_zone(&contents_copy);
update_free_zone(&contents_copy);
return ret;
}
ret = finalize_updated_zone(contents_copy, true);
if (ret != KNOT_EOK) {
update_rollback(change);
update_free_old_zone(&contents_copy);
update_free_zone(&contents_copy);
return ret;
}
......@@ -633,7 +633,7 @@ void updates_rollback(list_t *chgs)
}
}
void update_free_old_zone(zone_contents_t **contents)
void update_free_zone(zone_contents_t **contents)
{
zone_tree_apply((*contents)->nodes, free_additional, NULL);
zone_tree_deep_free(&(*contents)->nodes);
......
......@@ -107,11 +107,11 @@ void updates_rollback(list_t *chgs);
void update_rollback(changeset_t *change);
/*!
* \brief Frees old zone contents - i.e. contents that were used to create the
* shallow copy, but are now obsolete.
* \brief Shallow frees zone contents - either shallow copy after failed update
* or original zone contents after successful update.
*
* \param contents Contents to free.
*/
void update_free_old_zone(zone_contents_t **contents);
void update_free_zone(zone_contents_t **contents);
/*! @} */
......@@ -428,9 +428,9 @@ static bool skip_soa(const knot_rrset_t *rr, int64_t sn)
/* ---------------------- changeset manipulation ---------------------------- */
/*!< \brief Checks whether record should be added or replaced. */
static bool skip_record_addition(changeset_t *changeset,
const knot_rrset_t *rr)
/*!< \brief Replaces possible singleton RR type in changeset. */
static bool singleton_replaced(changeset_t *changeset,
const knot_rrset_t *rr)
{
if (!should_replace(rr)) {
return false;
......@@ -458,7 +458,7 @@ static bool skip_record_addition(changeset_t *changeset,
static int add_rr_to_chgset(const knot_rrset_t *rr, changeset_t *changeset,
int *apex_ns_rem)
{
if (skip_record_addition(changeset, rr)) {
if (singleton_replaced(changeset, rr)) {
return KNOT_EOK;
}
......
......@@ -543,14 +543,14 @@ static int event_dnssec(zone_t *zone)
log_zone_error("%s Could not sign zone (%s).\n",
msgpref, knot_strerror(ret));
update_rollback(&ch);
update_free_old_zone(&new_contents);
update_free_zone(&new_contents);
goto done;
}
/* Switch zone contents. */
zone_contents_t *old_contents = zone_switch_contents(zone, new_contents);
synchronize_rcu();
update_free_old_zone(&old_contents);
update_free_zone(&old_contents);
update_cleanup(&ch);
}
......
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