From 7ceb601418acf3108fd6b1a99e5093729ac31025 Mon Sep 17 00:00:00 2001 From: Lubos Slovak <lubos.slovak@nic.cz> Date: Tue, 2 Aug 2011 15:45:48 +0200 Subject: [PATCH] Removed include of zones in XFR refs #1048 @15m --- src/dnslib/debug.h | 13 ++++++++++++- src/knot/server/xfr-in.c | 11 ++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/dnslib/debug.h b/src/dnslib/debug.h index 1ea0e574a..97f6d0c5b 100644 --- a/src/dnslib/debug.h +++ b/src/dnslib/debug.h @@ -87,7 +87,18 @@ void dnslib_zone_contents_dump(dnslib_zone_contents_t *zone, char loaded_zone); //#define DNSLIB_ZLOAD_DEBUG //#define CUCKOO_DEBUG //#define CUCKOO_DEBUG_HASH -#define DNSLIB_NS_DEBUG +//#define DNSLIB_NS_DEBUG +//#define DNSLIB_XFR_DEBUG + +#ifdef DNSLIB_XFR_DEBUG +#define debug_dnslib_xfr(msg...) fprintf(stderr, msg) +#define debug_dnslib_xfr_hex(data, len) hex_print((data), (len)) +#define DEBUG_DNSLIB_NS(cmds) do { cmds } while (0) +#else +#define debug_dnslib_xfr(msg...) +#define debug_dnslib_xfr_hex(data, len) +#define DEBUG_DNSLIB_XFR(cmds) +#endif #ifdef DNSLIB_NS_DEBUG #define debug_dnslib_ns(msg...) fprintf(stderr, msg) diff --git a/src/knot/server/xfr-in.c b/src/knot/server/xfr-in.c index f67b354ff..0aebf40c6 100644 --- a/src/knot/server/xfr-in.c +++ b/src/knot/server/xfr-in.c @@ -1,4 +1,5 @@ #include <assert.h> +#include <urcu.h> #include "knot/server/xfr-in.h" //#include "knot/common.h" @@ -6,7 +7,7 @@ //#include "knot/other/error.h" /*! \todo Journal needs to be dnslib/common. */ -#include "knot/server/zones.h" /*! \todo Needs zonedata_t from zones.h */ +//#include "knot/server/zones.h" /*! \todo Needs zonedata_t from zones.h */ #include "common/evsched.h" @@ -78,8 +79,8 @@ static int xfrin_create_query(const dnslib_zone_contents_t *zone, uint16_t qtype } if (wire_size > *size) { - log_answer_warning("Not enough space provided for the wire " - "format of the query.\n"); + debug_dnslib_xfr("Not enough space provided for the wire " + "format of the query.\n"); dnslib_packet_free(&pkt); return DNSLIB_ESPACE; } @@ -202,7 +203,7 @@ int xfrin_transfer_needed(const dnslib_zone_contents_t *zone, if (soa_rrset == NULL) { char *name = dnslib_dname_to_str(dnslib_node_owner( dnslib_zone_contents_apex(zone))); - log_answer_warning("SOA RRSet missing in the zone %s!\n", name); + debug_dnslib_xfr("SOA RRSet missing in the zone %s!\n", name); free(name); return DNSLIB_ERROR; } @@ -211,7 +212,7 @@ int xfrin_transfer_needed(const dnslib_zone_contents_t *zone, dnslib_rrset_rdata(soa_rrset)); if (local_serial < 0) { char *name = dnslib_dname_to_str(dnslib_rrset_owner(soa_rrset)); - log_answer_warning("Malformed data in SOA of zone %s\n", name); + debug_dnslib_xfr("Malformed data in SOA of zone %s\n", name); free(name); return DNSLIB_EMALF; // maybe some other error } -- GitLab