cURL

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1388 Another problem with proxy CONNECT and Connection: Keep-Alive

From: Daniel Stenberg <bagder_at_users.sf.net>
Date: Fri, 04 Jul 2014 23:44:18 +0000

- **status**: open --> closed-accepted

---
** [bugs:#1388] Another problem with proxy CONNECT and Connection: Keep-Alive**
**Status:** closed-accepted
**Created:** Mon Jun 30, 2014 04:08 PM UTC by Marcel Raad
**Last Updated:** Thu Jul 03, 2014 09:32 AM UTC
**Owner:** Daniel Stenberg
This issue occurs in the same setup as [#1381], but with the correct proxy credentials preset with CURLOPT_PROXYUSERNAME and CURLOPT_PROXYPASSWORD.
I'm using libcurl 7.37.0 (built with SSPI on Windows) and I'm trying to establish a proxy tunnel through a squid 3.2.11 proxy. Both CURLOPT_HTTPPROXYTUNNEL and CURLOPT_CONNECT_ONLY are set to 1. The problem occurs only if the proxy does not send "(Proxy-)Connection: Close" together with "407 Proxy Authentication Required". It also does not occurs if I set exactly the authentication method required by the proxy (Basic) with CURLOPT_PROXYAUTH.
The problem is that after the proxy tunnel is established successfully, nothing ever happens (none of my callbacks are ever called) until the timeout occurs (no matter how high the values of CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT are, I have tested with values between 3 and 60 seconds). Then my timeout triggers and curl_multi_info_read returns with CURLE_OPERATION_TIMEDOUT.
The big difference to a working proxy that sends "Proxy-Connection: Close" together with "407 Proxy Authentication Required" is that the working proxy ends up in the "if(data->easy_conn->bits.proxy_connect_closed)" case after the call to Curl_http_connect in the CURLM_STATE_WAITPROXYCONNECT case of multi_runsingle, while the failing proxy ends up in "else if((CURLE_OK == data->result) && (data->easy_conn->tunnel_state[FIRSTSOCKET] == TUNNEL_COMPLETE))".
The attached patch (against current git revision 1b6bc02fb926403f04061721f9159e9887202a96) fixes the problem for me, but I have no idea if it is correct or breaks other use cases.
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2014-07-05

These mail archives are generated by hypermail.

donate! Page updated March 21, 2014.
web site info

File upload with ASP.NET