cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-2069047 ] Proxy connection close during auth not handled by multi

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sat, 23 Aug 2008 12:11:54 +0000

Bugs item #2069047, was opened at 2008-08-23 07:21
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2069047&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: https
Group: wrong behaviour
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Constantine Sapuntzakis (csapuntz)
Assigned to: Daniel Stenberg (bagder)
Summary: Proxy connection close during auth not handled by multi

Initial Comment:
When doing a CONNECT request through a ISA Server 2006
proxy that requires authentication, the ISA proxy returns Connection:Close on the initial connection along with the authentication header.

curl_easy path handles this correctly by opening a new connection to the proxy and redoing the handshake with the chosen auth protocol.

curl_multi is missing this logic in the state machine.

The patch below adds that logic to the state machine.

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2008-08-23 14:11

Message:
Logged In: YES
user_id=1110
Originator: NO

Thanks a lot, patch applied and committed!

----------------------------------------------------------------------

Comment By: Constantine Sapuntzakis (csapuntz)
Date: 2008-08-23 07:24

Message:
Logged In: YES
user_id=669005
Originator: YES

Here's the patch since I can't seem to attach the file due to some silly
sourceforge error:

--- curl-7.18.1.dist/lib/multi.c Thu Mar 20 04:09:59 2008
+++ curl-7.18.1/lib/multi.c Fri Aug 22 21:03:12 2008
@@ -987,7 +987,16 @@
       /* this is HTTP-specific, but sending CONNECT to a proxy is HTTP...
*/
       easy->result = Curl_http_connect(easy->easy_conn,
&protocol_connect);
 
- if(CURLE_OK == easy->result) {
+ if(easy->easy_conn->bits.proxy_connect_closed) {
+ /* reset the error buffer */
+ if(easy->easy_handle->set.errorbuffer)
+ easy->easy_handle->set.errorbuffer[0] = '\0';
+ easy->easy_handle->state.errorbuf = FALSE;
+
+ easy->result = CURLE_OK;
+ result = CURLM_CALL_MULTI_PERFORM;
+ multistate(easy, CURLM_STATE_CONNECT);
+ } else if (CURLE_OK == easy->result) {
         if(!easy->easy_conn->bits.tunnel_connecting)
           multistate(easy, CURLM_STATE_WAITCONNECT);
       }

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2069047&group_id=976
Received on 2008-08-23

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET