]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2487. [bug] Give TCP connections longer to complete. [RT #18675]
authorMark Andrews <marka@isc.org>
Thu, 20 Nov 2008 01:29:33 +0000 (01:29 +0000)
committerMark Andrews <marka@isc.org>
Thu, 20 Nov 2008 01:29:33 +0000 (01:29 +0000)
CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 3c039fb553e4493810a6fb6655db5449bb62bedb..76febe01594d54257ab5973db63136d9e66d584c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,8 @@
                        warning or crash named with the debug 1 level
                        of logging. [RT #18917]
 
+2487.  [bug]           Give TCP connections longer to complete. [RT #18675]
+
 2485.  [bug]           Change update's the handling of obscured RRSIG
                        records.  Not all orphand DS records were being
                        removed. [RT #18828]
index 0cbdb464950beade529491f1e03a098e6a03e2bb..b963f341625b8dd6f0a212af7332771de7461fa1 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.284.18.80 2008/11/20 01:13:51 marka Exp $ */
+/* $Id: resolver.c,v 1.284.18.81 2008/11/20 01:29:33 marka Exp $ */
 
 /*! \file */
 
@@ -522,14 +522,13 @@ fctx_stoptimer(fetchctx_t *fctx) {
 
 
 static inline isc_result_t
-fctx_startidletimer(fetchctx_t *fctx) {
+fctx_startidletimer(fetchctx_t *fctx, isc_interval_t *interval) {
        /*
         * Start the idle timer for fctx.  The lifetime timer continues
         * to be in effect.
         */
        return (isc_timer_reset(fctx->timer, isc_timertype_once,
-                               &fctx->expires, &fctx->interval,
-                               ISC_FALSE));
+                               &fctx->expires, interval, ISC_FALSE));
 }
 
 /*
@@ -1095,7 +1094,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
        task = res->buckets[fctx->bucketnum].task;
 
        fctx_setretryinterval(fctx, addrinfo->srtt);
-       result = fctx_startidletimer(fctx);
+       result = fctx_startidletimer(fctx, &fctx->interval);
        if (result != ISC_R_SUCCESS)
                return (result);
 
@@ -1672,6 +1671,7 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
        isc_socketevent_t *sevent = (isc_socketevent_t *)event;
        resquery_t *query = event->ev_arg;
        isc_boolean_t retry = ISC_FALSE;
+       isc_interval_t interval;
        isc_result_t result;
        unsigned int attrs;
        fetchctx_t *fctx;
@@ -1704,6 +1704,20 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
        } else {
                switch (sevent->result) {
                case ISC_R_SUCCESS:
+
+                       /*
+                        * Extend the idle timer for TCP.  20 seconds
+                        * should be long enough for a TCP connection to be
+                        * established, a single DNS request to be sent,
+                        * and the response received.
+                        */
+                       isc_interval_set(&interval, 20, 0);
+                       result = fctx_startidletimer(query->fctx, &interval);
+                       if (result != ISC_R_SUCCESS) {
+                               fctx_cancelquery(&query, NULL, NULL, ISC_FALSE);
+                               fctx_done(fctx, result);
+                               break;
+                       }
                        /*
                         * We are connected.  Create a dispatcher and
                         * send the query.
@@ -1736,8 +1750,7 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
                                result = resquery_send(query);
 
                        if (result != ISC_R_SUCCESS) {
-                               fctx_cancelquery(&query, NULL, NULL,
-                                                ISC_FALSE);
+                               fctx_cancelquery(&query, NULL, NULL, ISC_FALSE);
                                fctx_done(fctx, result);
                        }
                        break;