mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Cleanup: always count ns_statscounter_recursclients
The ns_statscounter_recursclients counter was previously only incremented or decremented if client->recursionquota was non-NULL. This was harmless, because that value should always be non-NULL if recursion is enabled, but it made the code slightly confusing.
This commit is contained in:
parent
81deb24deb
commit
0201eab655
1 changed files with 21 additions and 15 deletions
|
|
@ -2530,10 +2530,11 @@ prefetch_done(isc_task_t *task, isc_event_t *event) {
|
|||
*/
|
||||
if (client->recursionquota != NULL) {
|
||||
isc_quota_detach(&client->recursionquota);
|
||||
ns_stats_decrement(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
}
|
||||
|
||||
ns_stats_decrement(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
|
||||
free_devent(client, &event, &devent);
|
||||
isc_nmhandle_detach(&client->prefetchhandle);
|
||||
}
|
||||
|
|
@ -2562,8 +2563,6 @@ query_prefetch(ns_client_t *client, dns_name_t *qname,
|
|||
&client->recursionquota);
|
||||
switch (result) {
|
||||
case ISC_R_SUCCESS:
|
||||
ns_stats_increment(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
break;
|
||||
case ISC_R_SOFTQUOTA:
|
||||
isc_quota_detach(&client->recursionquota);
|
||||
|
|
@ -2573,6 +2572,9 @@ query_prefetch(ns_client_t *client, dns_name_t *qname,
|
|||
}
|
||||
}
|
||||
|
||||
ns_stats_increment(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
|
||||
tmprdataset = ns_client_newrdataset(client);
|
||||
if (tmprdataset == NULL) {
|
||||
return;
|
||||
|
|
@ -2781,8 +2783,6 @@ query_rpzfetch(ns_client_t *client, dns_name_t *qname, dns_rdatatype_t type) {
|
|||
&client->recursionquota);
|
||||
switch (result) {
|
||||
case ISC_R_SUCCESS:
|
||||
ns_stats_increment(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
break;
|
||||
case ISC_R_SOFTQUOTA:
|
||||
isc_quota_detach(&client->recursionquota);
|
||||
|
|
@ -2792,6 +2792,9 @@ query_rpzfetch(ns_client_t *client, dns_name_t *qname, dns_rdatatype_t type) {
|
|||
}
|
||||
}
|
||||
|
||||
ns_stats_increment(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
|
||||
tmprdataset = ns_client_newrdataset(client);
|
||||
if (tmprdataset == NULL) {
|
||||
return;
|
||||
|
|
@ -6253,10 +6256,11 @@ fetch_callback(isc_task_t *task, isc_event_t *event) {
|
|||
|
||||
if (client->recursionquota != NULL) {
|
||||
isc_quota_detach(&client->recursionquota);
|
||||
ns_stats_decrement(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
}
|
||||
|
||||
ns_stats_decrement(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
|
||||
LOCK(&client->manager->reclock);
|
||||
if (ISC_LINK_LINKED(client, rlink)) {
|
||||
ISC_LIST_UNLINK(client->manager->recursing, client, rlink);
|
||||
|
|
@ -6390,11 +6394,6 @@ check_recursionquota(ns_client_t *client) {
|
|||
result =
|
||||
isc_quota_attach(&client->manager->sctx->recursionquota,
|
||||
&client->recursionquota);
|
||||
if (result == ISC_R_SUCCESS || result == ISC_R_SOFTQUOTA) {
|
||||
ns_stats_increment(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
}
|
||||
|
||||
if (result == ISC_R_SOFTQUOTA) {
|
||||
isc_stdtime_t now;
|
||||
isc_stdtime_get(&now);
|
||||
|
|
@ -6477,6 +6476,9 @@ ns_query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qname,
|
|||
return (result);
|
||||
}
|
||||
|
||||
ns_stats_increment(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
|
||||
/*
|
||||
* Invoke the resolver.
|
||||
*/
|
||||
|
|
@ -6767,10 +6769,11 @@ query_hookresume(isc_task_t *task, isc_event_t *event) {
|
|||
|
||||
if (client->recursionquota != NULL) {
|
||||
isc_quota_detach(&client->recursionquota);
|
||||
ns_stats_decrement(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
}
|
||||
|
||||
ns_stats_decrement(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
|
||||
LOCK(&client->manager->reclock);
|
||||
if (ISC_LINK_LINKED(client, rlink)) {
|
||||
ISC_LIST_UNLINK(client->manager->recursing, client, rlink);
|
||||
|
|
@ -6906,6 +6909,9 @@ ns_query_hookasync(query_ctx_t *qctx, ns_query_starthookasync_t runasync,
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
ns_stats_increment(client->manager->sctx->nsstats,
|
||||
ns_statscounter_recursclients);
|
||||
|
||||
saved_qctx = isc_mem_get(client->manager->mctx, sizeof(*saved_qctx));
|
||||
qctx_save(qctx, saved_qctx);
|
||||
result = runasync(saved_qctx, client->manager->mctx, arg,
|
||||
|
|
|
|||
Loading…
Reference in a new issue