On Thu, 17 Feb 2011, Alona Rossen wrote:

Sorry, it is "wait in vain".

Thanks to your test program I could also easily repeat this problem and attached here is my suggested fix. Let me know how it works for you. It solved the case for me and all test cases still run fine.

It wasn't about a non-existent path, but about the fact that the SSL handshaking failed (was denied).

--

 / daniel.haxx.se
From c2ba90e416f30e9d19419f52be4b3a16a625f571 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <[email protected]>
Date: Thu, 17 Feb 2011 23:51:43 +0100
Subject: [PATCH] multi: better failed connect treatment

When failing to connect the protocol during the CURLM_STATE_PROTOCONNECT
state, Curl_done() has to be called with the premature flag set TRUE as
for the pingpong protocols this can be important.

When Curl_done() is called with premature == TRUE, it needs to call
Curl_disconnect() with its 'dead_connection' argument set to TRUE as
well so that any protocol handler's disconnect function won't attempt to
use the (control) connection for anything.

This problem caused the pingpong protocols to fail to disconnect when
STARTTLS failed.

Bug: http://curl.haxx.se/mail/lib-2011-02/0195.html
---
 lib/multi.c |    2 +-
 lib/url.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/multi.c b/lib/multi.c
index 122f66b..3112702 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1189,7 +1189,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
       else if(easy->result) {
         /* failure detected */
         Curl_posttransfer(data);
-        Curl_done(&easy->easy_conn, easy->result, FALSE);
+        Curl_done(&easy->easy_conn, easy->result, TRUE);
         disconnect_conn = TRUE;
       }
       break;
diff --git a/lib/url.c b/lib/url.c
index c075541..c1dab82 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -5281,7 +5281,7 @@ CURLcode Curl_done(struct connectdata **connp,
   */
   if(data->set.reuse_forbid || conn->bits.close || premature ||
      (-1 == conn->connectindex)) {
-    CURLcode res2 = Curl_disconnect(conn, FALSE); /* close the connection */
+    CURLcode res2 = Curl_disconnect(conn, premature); /* close the connection */
 
     /* If we had an error already, make sure we return that one. But
        if we got a new error, return that. */
-- 
1.7.2.3

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to