mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
convert tracing into debug logging
This commit is contained in:
parent
772a802cd0
commit
6fe8621e7f
@ -39,6 +39,7 @@
|
||||
#include <dns/rdataset.h>
|
||||
#include <dns/tsig.h>
|
||||
#include <dns/view.h>
|
||||
#include <dns/log.h>
|
||||
|
||||
#include <dst/dst.h>
|
||||
|
||||
@ -46,24 +47,39 @@
|
||||
|
||||
#define DNS_RESOLVER_TRACE
|
||||
#ifdef DNS_RESOLVER_TRACE
|
||||
#define RTRACE(m) printf("res %p: %s\n", res, (m))
|
||||
#define RRTRACE(r, m) printf("res %p: %s\n", (r), (m))
|
||||
#define FCTXTRACE(m) printf("fctx %p: %s\n", fctx, (m))
|
||||
#define FTRACE(m) printf("fetch %p (fctx %p): %s\n", \
|
||||
#define RTRACE(m) isc_log_write(dns_lctx, \
|
||||
DNS_LOGCATEGORY_RESOLVER, \
|
||||
DNS_LOGMODULE_RESOLVER, \
|
||||
ISC_LOG_DEBUG(1), \
|
||||
"res %p: %s", res, (m))
|
||||
#define RRTRACE(r, m) isc_log_write(dns_lctx, \
|
||||
DNS_LOGCATEGORY_RESOLVER, \
|
||||
DNS_LOGMODULE_RESOLVER, \
|
||||
ISC_LOG_DEBUG(1), \
|
||||
"res %p: %s", (r), (m))
|
||||
#define FCTXTRACE(m) isc_log_write(dns_lctx, \
|
||||
DNS_LOGCATEGORY_RESOLVER, \
|
||||
DNS_LOGMODULE_RESOLVER, \
|
||||
ISC_LOG_DEBUG(1), \
|
||||
"fctx %p: %s", fctx, (m))
|
||||
#define FTRACE(m) isc_log_write(dns_lctx, \
|
||||
DNS_LOGCATEGORY_RESOLVER, \
|
||||
DNS_LOGMODULE_RESOLVER, \
|
||||
ISC_LOG_DEBUG(1), \
|
||||
"fetch %p (fctx %p): %s", \
|
||||
fetch, fetch->private, (m))
|
||||
#define QTRACE(m) printf("query %p (res %p fctx %p): %s\n", \
|
||||
query, query->fctx->res, query->fctx, (m))
|
||||
#define QTRACERESULT(m, r) \
|
||||
printf("query %p (res %p fctx %p): %s, result = %s\n", \
|
||||
query, query->fctx->res, query->fctx, (m), \
|
||||
isc_result_totext((r)))
|
||||
#define QTRACE(m) isc_log_write(dns_lctx, \
|
||||
DNS_LOGCATEGORY_RESOLVER, \
|
||||
DNS_LOGMODULE_RESOLVER, \
|
||||
ISC_LOG_DEBUG(1), \
|
||||
"resquery %p (fctx %p): %s", \
|
||||
query, query->fctx, (m))
|
||||
#else
|
||||
#define RTRACE(m)
|
||||
#define RRTRACE(r, m)
|
||||
#define FCTXTRACE(m)
|
||||
#define FTRACE(m)
|
||||
#define QTRACE(m)
|
||||
#define QTRACERESULT(m, r)
|
||||
#endif
|
||||
|
||||
|
||||
@ -311,8 +327,6 @@ resquery_senddone(isc_task_t *task, isc_event_t *event) {
|
||||
|
||||
(void)task;
|
||||
|
||||
QTRACERESULT("senddone", sevent->result);
|
||||
|
||||
if (sevent->result != ISC_R_SUCCESS)
|
||||
fctx_cancelquery(&query, NULL);
|
||||
|
||||
@ -2165,13 +2179,11 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
|
||||
if (keep_trying) {
|
||||
if (result == DNS_R_FORMERR)
|
||||
broken_server = ISC_TRUE;
|
||||
if (broken_server) {
|
||||
/*
|
||||
* XXXRTH We will mark the sender as bad here instead
|
||||
* of doing the printf().
|
||||
* XXXRTH If we have a broken server at this poing, we will
|
||||
* decrease its 'goodness', possibly add a 'lame'
|
||||
* entry, and maybe log a message.
|
||||
*/
|
||||
printf("broken server\n");
|
||||
}
|
||||
/*
|
||||
* Do we need to find the best nameservers for this fetch?
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user