]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2757. [bug] dig: assertion failure could occur in connect
authorEvan Hunt <each@isc.org>
Tue, 10 Nov 2009 17:27:40 +0000 (17:27 +0000)
committerEvan Hunt <each@isc.org>
Tue, 10 Nov 2009 17:27:40 +0000 (17:27 +0000)
timeout. [RT #20599]

CHANGES
bin/dig/dighost.c

diff --git a/CHANGES b/CHANGES
index 9008e997ce9d678cb9ddf5d8572d2283b6f622b1..b61e6e2e414019890b60ef5547352abf89310ae5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2757.  [bug]           dig: assertion failure could occur in connect
+                       timeout. [RT #20599]
+
 2756.  [bug]           Fixed corrupt logfile message in update.c. [RT# 20597]
 
 2755.  [placeholder]
index 0673b99676fb8b742048880b08d89752518d7841..b2761ad8f836f8aa7c40fa6aa8580f359a4ecc1c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dighost.c,v 1.327 2009/11/05 01:57:49 each Exp $ */
+/* $Id: dighost.c,v 1.328 2009/11/10 17:27:40 each Exp $ */
 
 /*! \file
  *  \note
@@ -2581,14 +2581,10 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
                cq = query->lookup->current_query;
                if (!l->tcp_mode)
                        send_udp(ISC_LIST_NEXT(cq, link));
-               else if (query->sock != NULL) {
-                       isc_socket_cancel(query->sock, NULL,
-                                         ISC_SOCKCANCEL_ALL);
-                       isc_socket_detach(&query->sock);
-                       sockcount--;
-                       debug("sockcount=%d", sockcount);
-                       send_tcp_connect(ISC_LIST_NEXT(cq, link));
-               } else {
+               else {
+                       if (query->sock != NULL)
+                               isc_socket_cancel(query->sock, NULL,
+                                                 ISC_SOCKCANCEL_ALL);
                        send_tcp_connect(ISC_LIST_NEXT(cq, link));
                }
                UNLOCK_LOOKUP;
@@ -2792,8 +2788,8 @@ connect_done(isc_task_t *task, isc_event_t *event) {
        if (sevent->result == ISC_R_CANCELED) {
                debug("in cancel handler");
                isc_socket_detach(&query->sock);
+               INSIST(sockcount > 0);
                sockcount--;
-               INSIST(sockcount >= 0);
                debug("sockcount=%d", sockcount);
                query->waiting_connect = ISC_FALSE;
                isc_event_free(&event);