1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-13 13:05:03 -05:00

multi-socks: fix connect to proxy

When connecting to a socks or similar proxy we do the proxy handshake at
once when we know the TCP connect is completed and we only consider the
"connection" complete after the proxy handshake. This fixes test 564
which is now no longer considered disabled.

Reported by: Dmitri Shubin
Bug: http://curl.haxx.se/mail/lib-2011-04/0127.html
This commit is contained in:
Daniel Stenberg 2011-04-28 09:39:33 +02:00
parent 53ef3493bf
commit 4a42e5cdaa
4 changed files with 9 additions and 9 deletions

View File

@ -698,7 +698,13 @@ CURLcode Curl_is_connected(struct connectdata *conn,
if(WAITCONN_CONNECTED == rc) { if(WAITCONN_CONNECTED == rc) {
if(verifyconnect(sockfd, &error)) { if(verifyconnect(sockfd, &error)) {
/* we are connected, awesome! */ /* we are connected with TCP, awesome! */
/* see if we need to do any proxy magic first once we connected */
code = Curl_connected_proxy(conn);
if(code)
return code;
conn->bits.tcpconnect = TRUE; conn->bits.tcpconnect = TRUE;
*connected = TRUE; *connected = TRUE;
Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */ Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */

View File

@ -1141,8 +1141,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
FIRSTSOCKET, FIRSTSOCKET,
&connected); &connected);
if(connected) { if(connected) {
/* see if we need to do any proxy magic first once we connected */
easy->result = Curl_connected_proxy(easy->easy_conn);
if(!easy->result) if(!easy->result)
/* if everything is still fine we do the protocol-specific connect /* if everything is still fine we do the protocol-specific connect

View File

@ -2,5 +2,4 @@
# test cases are run by runtests.pl. Just add the plain test case numbers, one # test cases are run by runtests.pl. Just add the plain test case numbers, one
# per line. # per line.
# Lines starting with '#' letters are treated as comments. # Lines starting with '#' letters are treated as comments.
564
811 811

View File

@ -47,11 +47,8 @@ PWD
CWD path CWD path
EPSV EPSV
TYPE I TYPE I
SIZE 546 SIZE 564
RETR 546 RETR 564
EPSV
SIZE 546
RETR 546
QUIT QUIT
</protocol> </protocol>
<stdout> <stdout>