Issue #175: Include query in call_reporting dict

Thanks Tom Pusateri
This commit is contained in:
Willem Toorop 2020-02-20 17:52:27 +01:00
parent 56ca583fa6
commit e2c6241964
4 changed files with 28 additions and 1 deletions

View File

@ -4,6 +4,8 @@
* Issue #430: Record and guard UDP max payload size with servers.
* Issue #407: Run only offline-tests option with:
src/test/tpkg/run-offline-only.sh (only with git checkouts).
* Issue #175: Include the packet the stub resolver sent to the
upstream the call_reporting dict. Thanks Tom Pusateri
* 2019-12-20: Version 1.6.0-beta.1
* Migration of build system to cmake. Build now works on Ubuntu,

View File

@ -38,6 +38,10 @@
#include "types-internal.h"
#include <stdio.h>
getdns_return_t
_getdns_wire2msg_dict_scan(struct mem_funcs *mf,
const uint8_t **wire, size_t *wire_len, getdns_dict **msg_dict);
getdns_return_t _getdns_wire2rr_dict(struct mem_funcs *mf,
const uint8_t *wire, size_t wire_len, getdns_dict **rr_dict);

View File

@ -51,6 +51,7 @@
#include "gldns/gbuffer.h"
#include "gldns/pkthdr.h"
#include "dnssec.h"
#include "convert.h"
getdns_return_t
@ -820,6 +821,9 @@ _getdns_create_call_reporting_dict(
getdns_bindata qname;
getdns_dict *netreq_debug;
getdns_dict *address_debug = NULL;
getdns_dict *query_dict = NULL;
const uint8_t *wire;
size_t wire_len;
assert(netreq);
@ -856,6 +860,23 @@ _getdns_create_call_reporting_dict(
return NULL;
}
/* Stub resolver debug data */
wire = netreq->query;
wire_len = netreq->response - netreq->query;
if (!wire)
; /* pass */
else if(_getdns_wire2msg_dict_scan(
&netreq_debug->mf, &wire, &wire_len, &query_dict)) {
getdns_dict_destroy(netreq_debug);
return NULL;
} else if (_getdns_dict_set_this_dict(
netreq_debug, "query", query_dict)) {
getdns_dict_destroy(netreq_debug);
return NULL;
}
_getdns_sockaddr_to_dict(
context, &netreq->upstream->addr, &address_debug);

2
stubby

@ -1 +1 @@
Subproject commit df3be6e68952dc6c04d2d87906f8943365e10f3f
Subproject commit a105556619d4873d20e18580cdbf877514e38405