From: Mark Andrews Date: Thu, 27 Jan 2011 02:24:49 +0000 (+0000) Subject: 3009. [bug] clients-per-query code didn't work as expected with X-Git-Tag: v9.8.0-P1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fba20bd0b3501f4c7e751e239e0992bf92443bf;p=thirdparty%2Fbind9.git 3009. [bug] clients-per-query code didn't work as expected with particular query patterns. [RT #22972] --- diff --git a/CHANGES b/CHANGES index 94ccd4bb9a5..8e815b0f3d6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3009. [bug] clients-per-query code didn't work as expected with + particular query patterns. [RT #22972] --- 9.8.0b1 released --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index fd4640eb803..b6e87646849 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.426 2010/09/15 12:21:27 marka Exp $ */ +/* $Id: resolver.c,v 1.427 2011/01/27 02:24:49 marka Exp $ */ /*! \file */ @@ -7824,6 +7824,13 @@ static inline isc_boolean_t fctx_match(fetchctx_t *fctx, dns_name_t *name, dns_rdatatype_t type, unsigned int options) { + /* + * Don't match fetch contexts that are shutting down. + */ + if (fctx->cloned || fctx->state == fetchstate_done || + ISC_LIST_EMPTY(fctx->events)) + return (ISC_FALSE); + if (fctx->type != type || fctx->options != options) return (ISC_FALSE); return (dns_name_equal(&fctx->name, name)); @@ -7958,17 +7965,7 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name, } } - /* - * If we didn't have a fetch, would attach to a done fetch, this - * fetch has already cloned its results, or if the fetch has gone - * "idle" (no one was interested in it), we need to start a new - * fetch instead of joining with the existing one. - */ - if (fctx == NULL || - fctx->state == fetchstate_done || - fctx->cloned || - ISC_LIST_EMPTY(fctx->events)) { - fctx = NULL; + if (fctx == NULL) { result = fctx_create(res, name, type, domain, nameservers, options, bucketnum, &fctx); if (result != ISC_R_SUCCESS)