]> 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:29:47 +0000 (02:29 +0000)
committerMark Andrews <marka@isc.org>
Thu, 27 Jan 2011 02:29:47 +0000 (02:29 +0000)
                        particular query patterns. [RT #22972]

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 35406fc82fb4751b278c76fc4e71f0eef878c5ee..96a85f5e44e31ff25e9e62a6fe1301b96e707074 100644 (file)
--- 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.6.3rc1 released ---
 
index 84f3ed31ad52f4d86b1e3ddd7e356bf5980fccf0..c49df611ba5fa810d8bfd0cd46000408099e4d3b 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.384.14.28 2010/06/23 23:46:05 tbox Exp $ */
+/* $Id: resolver.c,v 1.384.14.29 2011/01/27 02:29:47 marka Exp $ */
 
 /*! \file */
 
@@ -7443,6 +7443,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));
@@ -7577,17 +7584,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)