]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3009. [bug] clients-per-query code didn't work as expected with
authorMark Andrews <marka@isc.org>
Thu, 27 Jan 2011 02:32:52 +0000 (02:32 +0000)
committerMark Andrews <marka@isc.org>
Thu, 27 Jan 2011 02:32:52 +0000 (02:32 +0000)
                        particular query patterns. [RT #22972]

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 7f12486cee83a66fb7a5a0dc0e31ab03425a4b14..fc5972a00e2c0b82fc2c479c3bfff75b137a6695 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3009.  [bug]           clients-per-query code didn't work as expected with
+                       particular query patterns. [RT #22972]
+
 3007.  [bug]           Named failed to preserve the case of domain names in
                        rdata which is not compressible when writing master
                        files.  [RT #22863]
index f14ac7fda5351cfdcdd296f85b64ad3fdec56d16..25893871eea35fd94a6fe59a1f53ee62b4ec9e2d 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.284.18.103 2010/06/23 23:45:21 tbox Exp $ */
+/* $Id: resolver.c,v 1.284.18.104 2011/01/27 02:32:52 marka Exp $ */
 
 /*! \file */
 
@@ -7075,6 +7075,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));
@@ -7209,17 +7216,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)