Wireformat debugging

This commit is contained in:
Willem Toorop 2015-02-03 11:38:11 +01:00
parent 9ed074e58d
commit aedc4366ff
2 changed files with 21 additions and 0 deletions

View File

@ -45,6 +45,9 @@
#include "util-internal.h"
#include "types-internal.h"
#include "rr-dict.h"
#if defined(WIRE_DEBUG) && WIRE_DEBUG
#include "gldns/wire2str.h"
#endif
/**
* this is a comprehensive list of extensions and their data types
@ -553,6 +556,23 @@ create_getdns_response(getdns_dns_req *completed_request)
/* info (bools) about dns_req */
int dnssec_return_status;
#if defined(WIRE_DEBUG) && WIRE_DEBUG
char *str_pkt;
for ( netreq_p = completed_request->netreqs
; ! r && (netreq = *netreq_p)
; netreq_p++) {
if (! netreq->result)
continue;
if ((str_pkt = gldns_wire2str_pkt(
netreq->response, netreq->max_udp_payload_size))) {
fprintf(stderr, "%s\n", str_pkt);
free(str_pkt);
}
}
#endif
dnssec_return_status = completed_request->dnssec_return_status ||
completed_request->dnssec_return_only_secure;

View File

@ -42,6 +42,7 @@
#include "context.h"
#define SCHED_DEBUG 0
#define WIRE_DEBUG 1
#ifdef S_SPLINT_S
# define INLINE