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-3033966 ] SOCKS proxies do not work with multi interface

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sat, 24 Jul 2010 09:51:50 +0000

Bugs item #3033966, was opened at 2010-07-24 10:51
Message generated for change (Tracker Item Submitted) made by robincornelius
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3033966&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: libcurl
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Robin Cornelius (robincornelius)
Assigned to: Daniel Stenberg (bagder)
Summary: SOCKS proxies do not work with multi interface

Initial Comment:
I have found that connections via a SOCKS5 proxy are failing when using the multi interface. The symptoms are that the proxy does not receive the setup packets/auth packets and instead libcurl sends the request data directly resulting in a socks protocol error. I have looked through the code in git and done some tests, it appears that libcurl 7.20.0 works fine but 7.20.1 results in socks protocol errors. (I noticed this when upgrading libcurl used by my app from 7.19.6 to 7.21.0.

Further tests indicate that Commit:4b351d018e3d6691191fd653a17f14f4a31e0b4c introduced un expected behaviour with socks proxies and the multi interface.

The problem occurs in the multi interface state machine, because on the multi interface connects are non blocking have have a timeout of 0, the STATE_CONNECT returns before the socket to the proxy is connected and we enter the STATE_WAITCONNECT

case CURLM_STATE_WAITCONNECT:
      /* awaiting a completion of an asynch connect */
      easy->result = Curl_is_connected(easy->easy_conn,
                                       FIRSTSOCKET,
                                       &connected);
      if(connected) {
        /* see if we need to do any proxy magic first once we connected */
        easy->result = Curl_connected_proxy(easy->easy_conn);

Curl_is_connected() since 4b351d018 sets conn->bits.tcpconnect = TRUE;

Curl_connected_proxy() tests for conn->bits.tcpconnect == TRUE and returns with out setting up the proxy

Attached is a patch that allows Curl_connected_proxy() to run when conn->bits.tcpconnect == TRUE and the multi interface is in use, comments in that function seem to suguest that this should have been allowed?

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3033966&group_id=976
Received on 2010-07-24

These mail archives are generated by hypermail.

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

File upload with ASP.NET