]> 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:13 +0000 (17:27 +0000)
committerEvan Hunt <each@isc.org>
Tue, 10 Nov 2009 17:27:13 +0000 (17:27 +0000)
timeout. [RT #20599]

CHANGES
bin/dig/dighost.c

diff --git a/CHANGES b/CHANGES
index d323230208bf6c0addbcc28a51437e917d43b5bd..1f31b1e5f57470c7ecb9a0e4a12d304e5210078d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2757.  [bug]           dig: assertion failure could occur in connect
+                       timeout. [RT #20599]
+
 2755.  [doc]           Clarify documentation of keyset- files in
                        dnssec-signzone man page. [RT #19810]
 
index bb913ad4e1bcf7f4220721a4401a2cb222da773c..d730c0ee5f34d6a7b716b8e9d8cff436a5945010 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dighost.c,v 1.311.70.10 2009/11/05 01:57:29 each Exp $ */
+/* $Id: dighost.c,v 1.311.70.11 2009/11/10 17:27:13 each Exp $ */
 
 /*! \file
  *  \note
@@ -2398,14 +2398,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;
@@ -2609,8 +2605,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);