mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
lock access to fctx->nqueries
This commit is contained in:
parent
03ed64c251
commit
5589748eca
1 changed files with 6 additions and 3 deletions
|
|
@ -1137,9 +1137,8 @@ resquery_destroy(resquery_t **queryp) {
|
|||
res = fctx->res;
|
||||
bucket = fctx->bucketnum;
|
||||
|
||||
fctx->nqueries--;
|
||||
|
||||
LOCK(&res->buckets[bucket].lock);
|
||||
fctx->nqueries--;
|
||||
empty = fctx_decreference(query->fctx);
|
||||
UNLOCK(&res->buckets[bucket].lock);
|
||||
|
||||
|
|
@ -1937,6 +1936,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
|
|||
bool have_addr = false;
|
||||
unsigned int srtt;
|
||||
isc_dscp_t dscp = -1;
|
||||
unsigned int bucketnum;
|
||||
|
||||
FCTXTRACE("query");
|
||||
|
||||
|
|
@ -2158,7 +2158,10 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
|
|||
fctx->querysent++;
|
||||
|
||||
ISC_LIST_APPEND(fctx->queries, query, link);
|
||||
query->fctx->nqueries++;
|
||||
bucketnum = fctx->bucketnum;
|
||||
LOCK(&res->buckets[bucketnum].lock);
|
||||
fctx->nqueries++;
|
||||
UNLOCK(&res->buckets[bucketnum].lock);
|
||||
if (isc_sockaddr_pf(&addrinfo->sockaddr) == PF_INET)
|
||||
inc_stats(res, dns_resstatscounter_queryv4);
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue