]> granicus.if.org Git - curl/commitdiff
Curl_wait_for_resolv() no longer disconnects on failure, but leaves that
authorDaniel Stenberg <daniel@haxx.se>
Tue, 8 Feb 2005 07:36:57 +0000 (07:36 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 8 Feb 2005 07:36:57 +0000 (07:36 +0000)
operation to the caller. Disconnecting has the disadvantage that the conn
pointer gets completely invalidated and this is not handled on lots of places
in the code.

lib/hostares.c
lib/transfer.c

index 48d62115e6c2df5aefbce7f0a67e3fc171d74d24..a54e25eda552301a2e040c4f2a17c0324f113ca5 100644 (file)
@@ -249,7 +249,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
 
     /* close the connection, since we can't return failure here without
        cleaning up this connection properly */
-    Curl_disconnect(conn);
+    conn->bits.close = TRUE;
   }
 
   return rc;
index bf67842a1732ad3e4b4572088e749ece18a5415d..ea7c5dbe34df87f3844414175419c3d2f899eaaf 100644 (file)
@@ -2038,6 +2038,8 @@ Curl_connect_host(struct SessionHandle *data,
       if(CURLE_OK == res)
         /* Resolved, continue with the connection */
         res = Curl_async_resolved(*conn);
+      else
+        (void)Curl_disconnect(*conn);
     }
     if(res)
       break;