Hi,

I ran into a client that could repeatedly get into a tight loop in the
do { } while loop in multi_runsingle() while in state WAITPROXYCONNECT.
While in this state conn->bits.proxy and conn->bits.httpproxy were 0 but
conn->bits.bits.tunnel_proxy was set.  conn->tunnel_state[FIRSTSOCKET]
was TUNNEL_INIT.  I don't think simply checking tunnel_proxy as per the
attached suggested diff is sufficient as it's possible this gets set via
the CURLOPT_HTTPPROXYTUNNEL option while the others remain 0.  If in
this state Curl_proxy_connect() doesn't make progress as it checks both
httpproxy and tunnel_proxy before doing anything.

Suggested diff attached that fixed the case I was seeing.

Regards,

Sean
---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential 
information, privileged material (including material protected by the 
solicitor-client or other applicable privileges), or constitute non-public 
information. Any use of this information by anyone other than the intended 
recipient is prohibited. If you have received this transmission in error, 
please immediately reply to the sender and delete this information from your 
system. Use, dissemination, distribution, or reproduction of this transmission 
by unintended recipients is not authorized and may be unlawful.
diff --git a/lib/multi.c b/lib/multi.c
index bd16f94..04ec169 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1185,7 +1185,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
       result = Curl_is_connected(data->easy_conn, FIRSTSOCKET, &connected);
       if(connected && !result) {
         rc = CURLM_CALL_MULTI_PERFORM;
-        multistate(data, data->easy_conn->bits.tunnel_proxy?
+        multistate(data, (data->easy_conn->bits.tunnel_proxy && 
data->easy_conn->bits.httpproxy) ?
                    CURLM_STATE_WAITPROXYCONNECT:
                    CURLM_STATE_SENDPROTOCONNECT);
       }
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to