]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2361. [bug] "recursion" statistics counter could be counted
authorTatuya JINMEI 神明達哉 <jinmei@isc.org>
Wed, 23 Apr 2008 01:14:24 +0000 (01:14 +0000)
committerTatuya JINMEI 神明達哉 <jinmei@isc.org>
Wed, 23 Apr 2008 01:14:24 +0000 (01:14 +0000)
multiple times for a single query.  [RT #17990]

CHANGES
bin/named/query.c

diff --git a/CHANGES b/CHANGES
index 2f7a4daaa84ac708f7b4163ec73c9be9a9ff3cbd..77ce4effae4d9bf707c74f081c1259b91d80c0b5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2361.  [bug]           "recursion" statistics counter could be counted
+                       multiple times for a single query.  [RT #17990]
+
 2360.  [bug]           Fix a condition where we release a database version
                        (which may acquire a lock) while holding the lock.
 
index ea5109a7f5fbeec8872a85141bc2292901b1222c..1caaf013e290fec142e5de3fc3d90977c4dc62dd 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.305 2008/04/03 05:55:51 marka Exp $ */
+/* $Id: query.c,v 1.306 2008/04/23 01:14:24 jinmei Exp $ */
 
 /*! \file */
 
@@ -2941,13 +2941,14 @@ query_resume(isc_task_t *task, isc_event_t *event) {
 
 static isc_result_t
 query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qdomain,
-             dns_rdataset_t *nameservers)
+             dns_rdataset_t *nameservers, isc_boolean_t resuming)
 {
        isc_result_t result;
        dns_rdataset_t *rdataset, *sigrdataset;
        isc_sockaddr_t *peeraddr;
 
-       inc_stats(client, dns_nsstatscounter_recursion);
+       if (!resuming)
+               inc_stats(client, dns_nsstatscounter_recursion);
 
        /*
         * We are about to recurse, which means that this client will
@@ -3352,6 +3353,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
        unsigned int options;
        isc_boolean_t empty_wild;
        dns_rdataset_t *noqname;
+       isc_boolean_t resuming;
 
        CTRACE("query_find");
 
@@ -3377,6 +3379,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
        need_wildcardproof = ISC_FALSE;
        empty_wild = ISC_FALSE;
        options = 0;
+       resuming = ISC_FALSE;
 
        if (event != NULL) {
                /*
@@ -3419,6 +3422,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
                }
 
                result = event->result;
+               resuming = ISC_TRUE;
 
                goto resume;
        }
@@ -3624,7 +3628,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
                         */
                        if (RECURSIONOK(client)) {
                                result = query_recurse(client, qtype,
-                                                      NULL, NULL);
+                                                      NULL, NULL, resuming);
                                if (result == ISC_R_SUCCESS)
                                        client->query.attributes |=
                                                NS_QUERYATTR_RECURSING;
@@ -3795,10 +3799,12 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
                                 */
                                if (dns_rdatatype_atparent(type))
                                        result = query_recurse(client, qtype,
-                                                              NULL, NULL);
+                                                              NULL, NULL,
+                                                              resuming);
                                else
                                        result = query_recurse(client, qtype,
-                                                              fname, rdataset);
+                                                              fname, rdataset,
+                                                              resuming);
                                if (result == ISC_R_SUCCESS)
                                        client->query.attributes |=
                                                NS_QUERYATTR_RECURSING;
@@ -4251,7 +4257,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
                                                result = query_recurse(client,
                                                                       qtype,
                                                                       NULL,
-                                                                      NULL);
+                                                                      NULL,
+                                                                      resuming);
                                                if (result == ISC_R_SUCCESS)
                                                    client->query.attributes |=
                                                        NS_QUERYATTR_RECURSING;