Commit 17db3ea1 authored by Daniel Salzman's avatar Daniel Salzman

zone-update: change zone_update_iter_finish return type to void

parent 9f4b3b9d
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -789,14 +789,13 @@ const zone_node_t *zone_update_iter_val(zone_update_iter_t *it)
}
}
int zone_update_iter_finish(zone_update_iter_t *it)
void zone_update_iter_finish(zone_update_iter_t *it)
{
if (it == NULL) {
return KNOT_EINVAL;
return;
}
hattrie_iter_free(it->base_it);
return KNOT_EOK;
}
bool zone_update_no_change(zone_update_t *update)
......
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -32,7 +32,7 @@
#include "libknot/mm_ctx.h"
/*! \brief Structure for zone contents updating / querying. */
typedef struct {
typedef struct zone_update {
zone_t *zone; /*!< Zone being updated. */
zone_contents_t *new_cont; /*!< New zone contents for full updates. */
changeset_t change; /*!< Changes we want to apply. */
......@@ -217,10 +217,8 @@ const zone_node_t *zone_update_iter_val(zone_update_iter_t *it);
* \brief Finish the iterator and clean it up.
*
* \param it Iterator.
*
* \return KNOT_E*
*/
int zone_update_iter_finish(zone_update_iter_t *it);
void zone_update_iter_finish(zone_update_iter_t *it);
/*!
* \brief Returns bool whether there are any changes at all.
......
/* Copyright (C) 2014 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2016 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -26,16 +26,10 @@
#include "knot/zone/node.h"
#include "zscanner/scanner.h"
static const char *zone_str1 =
"test. 3600 IN SOA a.ns.test. hostmaster.nic.cz. 1406641065 900 300 604800 900 \n";
static const char *zone_str2 =
"test. IN TXT \"test\"\n";
static const char *add_str =
"test. IN TXT \"test2\"\n";
static const char *del_str =
"test. IN TXT \"test\"\n";
static const char *zone_str1 = "test. 600 IN SOA ns.test. m.test. 1 900 300 4800 900 \n";
static const char *zone_str2 = "test. IN TXT \"test\"\n";
static const char *add_str = "test. IN TXT \"test2\"\n";
static const char *del_str = "test. IN TXT \"test\"\n";
knot_rrset_t rrset;
......@@ -130,8 +124,7 @@ void test_full(zone_t *zone, zs_scanner_t *sc)
iter_node = zone_update_iter_val(&it);
ok(iter_node == NULL, "full zone update: iter val past end");
ret = zone_update_iter_finish(&it);
ok(ret == KNOT_EOK, "full zone update: iter finish");
zone_update_iter_finish(&it);
ret = zone_update_commit(conf(), &update);
node = zone_contents_find_node_for_rr(zone->contents, &rrset);
......@@ -203,8 +196,7 @@ void test_incremental(zone_t *zone, zs_scanner_t *sc)
iter_node = zone_update_iter_val(&it);
ok(iter_node == NULL, "incremental zone update: iter val past end");
ret = zone_update_iter_finish(&it);
ok(ret == KNOT_EOK, "incremental zone update: iter finish");
zone_update_iter_finish(&it);
ret = zone_update_commit(conf(), &update);
iter_node = zone_contents_find_node_for_rr(zone->contents, &rrset);
......
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