diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-08-18 23:35:15 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-08-18 23:35:15 +0200 |
commit | b998d95b4d6de388ddc59a48714a2a1d9a43dc43 (patch) | |
tree | f216741373ddbb8907a59b8e1ada36e5cb12d632 /lib/connect.c | |
parent | d44896508ce73fdab43ad7ea713817b58432baa0 (diff) |
FTP: fix proxy connect race condition
When using the multi interface, a SOCKS proxy, and a connection that
wouldn't immediately consider itself connected (which my Linux tests do
by default), libcurl would be tricked into doing _two_ connects to the
SOCKS proxy when it setup the data connection and then of course the
second attempt would fail miserably and cause error.
This problem is a regression that was introduced by commit
4a42e5cdaa344755 that was introduced in the 7.21.7 release.
Bug: http://curl.haxx.se/mail/lib-2011-08/0199.html
Reported by: Fabian Keil
Diffstat (limited to 'lib/connect.c')
-rw-r--r-- | lib/connect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/connect.c b/lib/connect.c index 9301f0108..230d1055a 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -659,7 +659,7 @@ CURLcode Curl_is_connected(struct connectdata *conn, *connected = FALSE; /* a very negative world view is best */ - if(conn->bits.tcpconnect) { + if(conn->bits.tcpconnect[sockindex]) { /* we are connected already! */ *connected = TRUE; return CURLE_OK; @@ -698,7 +698,7 @@ CURLcode Curl_is_connected(struct connectdata *conn, if(code) return code; - conn->bits.tcpconnect = TRUE; + conn->bits.tcpconnect[sockindex] = TRUE; *connected = TRUE; Curl_pgrsTime(data, TIMER_CONNECT); /* connect done */ Curl_verboseconnect(conn); |