mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 08:02:06 -04:00
use dns_name_format() when logging queries
This commit is contained in:
parent
83a39d3f3c
commit
ad2c5d060d
1 changed files with 5 additions and 5 deletions
|
|
@ -2644,17 +2644,17 @@ query_find(ns_client_t *client, dns_fetchevent_t *event) {
|
|||
static inline void
|
||||
log_query(ns_client_t *client) {
|
||||
isc_buffer_t b;
|
||||
char text[1024];
|
||||
char namebuf[1024];
|
||||
char text[256];
|
||||
isc_region_t r;
|
||||
dns_rdataset_t *rdataset;
|
||||
|
||||
/* XXXRTH Allow this to be turned off! */
|
||||
|
||||
dns_name_format(client->query.qname, namebuf, sizeof(namebuf));
|
||||
|
||||
isc_buffer_init(&b, (unsigned char *)text, sizeof text,
|
||||
ISC_BUFFERTYPE_TEXT);
|
||||
if (dns_name_totext(client->query.qname, ISC_TRUE, &b) !=
|
||||
ISC_R_SUCCESS)
|
||||
return;
|
||||
for (rdataset = ISC_LIST_HEAD(client->query.qname->list);
|
||||
rdataset != NULL;
|
||||
rdataset = ISC_LIST_NEXT(rdataset, link)) {
|
||||
|
|
@ -2668,7 +2668,7 @@ log_query(ns_client_t *client) {
|
|||
}
|
||||
isc_buffer_used(&b, &r);
|
||||
ns_client_log(client, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_QUERY,
|
||||
ISC_LOG_DEBUG(1), "query: %.*s",
|
||||
ISC_LOG_DEBUG(1), "query: %s%.*s", namebuf,
|
||||
(int)r.length, (char *)r.base);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue