mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
use isc_log_wouldlog() to see whether to call log_rr(), and in log_rr()
don't bother using isc_buffer_usedregion() since the desired region values are easily accessible with the isc_buffer_used{,length}() functions.
This commit is contained in:
parent
e5f5ec73a7
commit
7cad5b3dbb
@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: xfrout.c,v 1.72 2000/08/09 00:09:30 gson Exp $ */
|
/* $Id: xfrout.c,v 1.73 2000/08/09 04:17:49 tale Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@ -61,6 +61,11 @@
|
|||||||
#define XFROUT_DEBUG_LOGARGS(n) \
|
#define XFROUT_DEBUG_LOGARGS(n) \
|
||||||
XFROUT_COMMON_LOGARGS, ISC_LOG_DEBUG(n)
|
XFROUT_COMMON_LOGARGS, ISC_LOG_DEBUG(n)
|
||||||
|
|
||||||
|
#define XFROUT_RR_LOGARGS \
|
||||||
|
XFROUT_COMMON_LOGARGS, XFROUT_RR_LOGLEVEL
|
||||||
|
|
||||||
|
#define XFROUT_RR_LOGLEVEL ISC_LOG_DEBUG(8)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fail unconditionally and log as a client error.
|
* Fail unconditionally and log as a client error.
|
||||||
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
|
* The test against ISC_R_SUCCESS is there to keep the Solaris compiler
|
||||||
@ -243,10 +248,8 @@ db_rr_iterator_current(db_rr_iterator_t *it, dns_name_t **name,
|
|||||||
static void
|
static void
|
||||||
log_rr(dns_name_t *name, dns_rdata_t *rdata, isc_uint32_t ttl) {
|
log_rr(dns_name_t *name, dns_rdata_t *rdata, isc_uint32_t ttl) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
|
||||||
isc_buffer_t buf;
|
isc_buffer_t buf;
|
||||||
char mem[2000];
|
char mem[2000];
|
||||||
isc_region_t r;
|
|
||||||
dns_rdatalist_t rdl;
|
dns_rdatalist_t rdl;
|
||||||
dns_rdataset_t rds;
|
dns_rdataset_t rds;
|
||||||
|
|
||||||
@ -268,17 +271,18 @@ log_rr(dns_name_t *name, dns_rdata_t *rdata, isc_uint32_t ttl) {
|
|||||||
* very long lines with a repetitive prefix.
|
* very long lines with a repetitive prefix.
|
||||||
*/
|
*/
|
||||||
if (result == ISC_R_SUCCESS) {
|
if (result == ISC_R_SUCCESS) {
|
||||||
/* Get rid of final newline. */
|
/*
|
||||||
|
* Get rid of final newline.
|
||||||
|
*/
|
||||||
INSIST(buf.used >= 1 &&
|
INSIST(buf.used >= 1 &&
|
||||||
((char *) buf.base)[buf.used - 1] == '\n');
|
((char *) buf.base)[buf.used - 1] == '\n');
|
||||||
buf.used--;
|
buf.used--;
|
||||||
|
|
||||||
isc_buffer_usedregion(&buf, &r);
|
isc_log_write(XFROUT_RR_LOGARGS, "%.*s",
|
||||||
isc_log_write(XFROUT_DEBUG_LOGARGS(8),
|
(int)isc_buffer_usedlength(&buf),
|
||||||
"%.*s", (int) r.length, (char *) r.base);
|
(char *)isc_buffer_used(&buf));
|
||||||
} else {
|
} else {
|
||||||
isc_log_write(XFROUT_DEBUG_LOGARGS(8),
|
isc_log_write(XFROUT_RR_LOGARGS, "<RR too large to print>");
|
||||||
"<RR too large to print>");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -934,15 +938,15 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype) {
|
|||||||
* Decide whether to allow this transfer.
|
* Decide whether to allow this transfer.
|
||||||
*/
|
*/
|
||||||
CHECK(ns_client_checkacl(client, "zone transfer",
|
CHECK(ns_client_checkacl(client, "zone transfer",
|
||||||
dns_zone_getxfracl(zone), ISC_TRUE, ISC_TRUE));
|
dns_zone_getxfracl(zone), ISC_TRUE,
|
||||||
|
ISC_TRUE));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AXFR over UDP is not possible.
|
* AXFR over UDP is not possible.
|
||||||
*/
|
*/
|
||||||
if (reqtype == dns_rdatatype_axfr &&
|
if (reqtype == dns_rdatatype_axfr &&
|
||||||
(client->attributes & NS_CLIENTATTR_TCP) == 0) {
|
(client->attributes & NS_CLIENTATTR_TCP) == 0)
|
||||||
FAILC(DNS_R_FORMERR, "attempted AXFR over UDP");
|
FAILC(DNS_R_FORMERR, "attempted AXFR over UDP");
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Look up the requesting server in the peer table.
|
* Look up the requesting server in the peer table.
|
||||||
@ -1315,6 +1319,7 @@ sendstream(xfrout_ctx_t *xfr) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isc_log_wouldlog(ns_g_lctx, XFROUT_RR_LOGLEVEL))
|
||||||
log_rr(name, rdata, ttl); /* XXX */
|
log_rr(name, rdata, ttl); /* XXX */
|
||||||
|
|
||||||
dns_message_gettempname(msg, &msgname);
|
dns_message_gettempname(msg, &msgname);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user