"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/knot/zone/zonedb.c" between
knot-2.9.1.tar.xz and knot-2.9.2.tar.xz

About: Knot DNS is a high-performance authoritative-only DNS server (supports zone transfers, dynamic updates and DNSSEC).

zonedb.c  (knot-2.9.1.tar.xz):zonedb.c  (knot-2.9.2.tar.xz)
skipping to change at line 27 skipping to change at line 27
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include "knot/journal/journal_metadata.h" #include "knot/journal/journal_metadata.h"
#include "knot/zone/zonedb.h" #include "knot/zone/zonedb.h"
#include "libknot/packet/wire.h" #include "libknot/packet/wire.h"
#include "contrib/mempattern.h" #include "contrib/mempattern.h"
#include "contrib/ucw/mempool.h" #include "contrib/ucw/mempool.h"
/*! \brief Discard zone in zone database. */ /*! \brief Discard zone in zone database. */
static void discard_zone(zone_t *zone) static void discard_zone(zone_t *zone, bool abort_txn)
{ {
// Don't flush if removed zone (no previous configuration available). // Don't flush if removed zone (no previous configuration available).
if (conf_rawid_exists(conf(), C_ZONE, zone->name, knot_dname_size(zone->n ame))) { if (conf_rawid_exists(conf(), C_ZONE, zone->name, knot_dname_size(zone->n ame))) {
uint32_t journal_serial, zone_serial = zone_contents_serial(zone- >contents); uint32_t journal_serial, zone_serial = zone_contents_serial(zone- >contents);
bool exists; bool exists;
// Flush if bootstrapped or if the journal doesn't exist. // Flush if bootstrapped or if the journal doesn't exist.
if (!zone->zonefile.exists || journal_info( if (!zone->zonefile.exists || journal_info(
zone_journal(zone), &exists, NULL, &journal_serial, NULL, NULL, NULL, NULL zone_journal(zone), &exists, NULL, NULL, &journal_serial, NULL, NULL, NULL, NULL
) != KNOT_EOK || !exists || journal_serial != zone_serial) { ) != KNOT_EOK || !exists || journal_serial != zone_serial) {
zone_flush_journal(conf(), zone, false); zone_flush_journal(conf(), zone, false);
} }
} }
if (abort_txn) {
zone_control_clear(zone);
}
zone_free(&zone); zone_free(&zone);
} }
knot_zonedb_t *knot_zonedb_new(void) knot_zonedb_t *knot_zonedb_new(void)
{ {
knot_zonedb_t *db = calloc(1, sizeof(knot_zonedb_t)); knot_zonedb_t *db = calloc(1, sizeof(knot_zonedb_t));
if (db == NULL) { if (db == NULL) {
return NULL; return NULL;
} }
skipping to change at line 158 skipping to change at line 161
{ {
if (db == NULL || *db == NULL) { if (db == NULL || *db == NULL) {
return; return;
} }
mp_delete((*db)->mm.ctx); mp_delete((*db)->mm.ctx);
free(*db); free(*db);
*db = NULL; *db = NULL;
} }
void knot_zonedb_deep_free(knot_zonedb_t **db) void knot_zonedb_deep_free(knot_zonedb_t **db, bool abort_txn)
{ {
if (db == NULL || *db == NULL) { if (db == NULL || *db == NULL) {
return; return;
} }
knot_zonedb_foreach(*db, discard_zone); knot_zonedb_foreach(*db, discard_zone, abort_txn);
knot_zonedb_free(db); knot_zonedb_free(db);
} }
 End of changes. 5 change blocks. 
4 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)