aboutsummaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2012-03-21 23:22:39 +0100
committerDaniel Stenberg <daniel@haxx.se>2012-03-22 00:12:37 +0100
commitc83de6d07625b813e3bbc31f9a0827c3a0007355 (patch)
treed55e987d195fc5dd5d0c3d23b4cc306c48667db6 /lib/multi.c
parent805788e0434f4f09d8049c51000af604efb800ed (diff)
CONNECT: fix multi interface regression
The refactoring of HTTP CONNECT handling in commit 41b0237834232 that made it protocol independent broke it for the multi interface. This fix now introduce a better state handling and moved some logic to the http_proxy.c source file. Reported by: Yang Tse Bug: http://curl.haxx.se/mail/lib-2012-03/0162.html
Diffstat (limited to 'lib/multi.c')
-rw-r--r--lib/multi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 6ec20ec80..b0104310b 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -812,7 +812,7 @@ static int waitconnect_getsock(struct connectdata *conn,
/* when we've sent a CONNECT to a proxy, we should rather wait for the
socket to become readable to be able to get the response headers */
- if(conn->bits.tunnel_connecting)
+ if(conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT)
return GETSOCK_READSOCK(0);
return GETSOCK_WRITESOCK(0);
@@ -1066,7 +1066,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
CURLM_STATE_WAITDO:CURLM_STATE_DO);
else {
#ifndef CURL_DISABLE_HTTP
- if(easy->easy_conn->bits.tunnel_connecting)
+ if(easy->easy_conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT)
multistate(easy, CURLM_STATE_WAITPROXYCONNECT);
else
#endif
@@ -1111,7 +1111,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
CURLM_STATE_WAITDO:CURLM_STATE_DO);
else {
#ifndef CURL_DISABLE_HTTP
- if(easy->easy_conn->bits.tunnel_connecting)
+ if(easy->easy_conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT)
multistate(easy, CURLM_STATE_WAITPROXYCONNECT);
else
#endif
@@ -1144,7 +1144,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
multistate(easy, CURLM_STATE_CONNECT);
}
else if(CURLE_OK == easy->result) {
- if(!easy->easy_conn->bits.tunnel_connecting)
+ if(easy->easy_conn->tunnel_state[FIRSTSOCKET] == TUNNEL_COMPLETE)
multistate(easy, CURLM_STATE_WAITCONNECT);
}
break;
@@ -1179,7 +1179,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
BUT if we are using a proxy we must change to WAITPROXYCONNECT
*/
#ifndef CURL_DISABLE_HTTP
- if(easy->easy_conn->bits.tunnel_connecting)
+ if(easy->easy_conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT)
multistate(easy, CURLM_STATE_WAITPROXYCONNECT);
else
#endif