2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

2541. [bug] Conditionally update dispatch manager statistics.

[RT #19247]
This commit is contained in:
Mark Andrews
2009-01-31 00:10:24 +00:00
parent 8b835581b4
commit f19e6ef1eb
2 changed files with 15 additions and 8 deletions

View File

@@ -1,3 +1,6 @@
2541. [bug] Conditionally update dispatch manager statistics.
[RT #19247]
2540. [func] Add a nibble mode to $GENERATE. [RT #18872]
2539. [security] Update the interaction between recursion, allow-query,

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dispatch.c,v 1.160 2009/01/27 22:29:59 jinmei Exp $ */
/* $Id: dispatch.c,v 1.161 2009/01/31 00:10:24 marka Exp $ */
/*! \file */
@@ -354,6 +354,12 @@ mgr_log(dns_dispatchmgr_t *mgr, int level, const char *fmt, ...) {
level, "dispatchmgr %p: %s", mgr, msgbuf);
}
static inline void
inc_stats(dns_dispatchmgr_t *mgr, dns_statscounter_t counter) {
if (mgr->stats != NULL)
isc_stats_increment(mgr->stats, counter);
}
static void
dispatch_log(dns_dispatch_t *disp, int level, const char *fmt, ...)
ISC_FORMAT_PRINTF(3, 4);
@@ -1263,8 +1269,7 @@ udp_recv(isc_event_t *ev_in, dns_dispatch_t *disp, dispsocket_t *dispsock) {
bucket, (resp == NULL ? "not found" : "found"));
if (resp == NULL) {
isc_stats_increment(mgr->stats,
dns_resstatscounter_mismatch);
inc_stats(mgr, dns_resstatscounter_mismatch);
free_buffer(disp, ev->region.base, ev->region.length);
goto unlock;
}
@@ -1272,7 +1277,7 @@ udp_recv(isc_event_t *ev_in, dns_dispatch_t *disp, dispsocket_t *dispsock) {
&resp->host)) {
dispatch_log(disp, LVL(90),
"response to an exclusive socket doesn't match");
isc_stats_increment(mgr->stats, dns_resstatscounter_mismatch);
inc_stats(mgr, dns_resstatscounter_mismatch);
free_buffer(disp, ev->region.base, ev->region.length);
goto unlock;
}
@@ -2986,8 +2991,8 @@ dns_dispatch_addresponse2(dns_dispatch_t *disp, isc_sockaddr_t *dest,
oldestresp->item_out = ISC_TRUE;
isc_task_send(oldestresp->task,
ISC_EVENT_PTR(&rev));
isc_stats_increment(disp->mgr->stats,
dns_resstatscounter_dispabort);
inc_stats(disp->mgr,
dns_resstatscounter_dispabort);
}
}
@@ -3011,8 +3016,7 @@ dns_dispatch_addresponse2(dns_dispatch_t *disp, isc_sockaddr_t *dest,
if (result != ISC_R_SUCCESS) {
UNLOCK(&qid->lock);
UNLOCK(&disp->lock);
isc_stats_increment(disp->mgr->stats,
dns_resstatscounter_dispsockfail);
inc_stats(disp->mgr, dns_resstatscounter_dispsockfail);
return (result);
}
} else {