summaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-06-07 23:02:26 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-06-14 23:43:52 +0200
commit5113ad0424044458ac497fa1458ebe0101356b22 (patch)
treea0fa92f49271bf09338e45fbed4173d303a4ae50 /lib/ftp.c
parent1213baba27a30a14f917e3c8c044f22cac2389b6 (diff)
downloadcurl-5113ad0424044458ac497fa1458ebe0101356b22.tar.gz
http-proxy: do the HTTP CONNECT process entirely non-blocking
Mentioned as a problem since 2007 (8f87c15bdac63) and of course it existed even before that. Closes #1547
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 5edec3761..f929c3407 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -272,7 +272,6 @@ static void close_secondarysocket(struct connectdata *conn)
conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD;
}
conn->bits.tcpconnect[SECONDARYSOCKET] = FALSE;
- conn->tunnel_state[SECONDARYSOCKET] = TUNNEL_INIT;
}
/*
@@ -3585,7 +3584,7 @@ static CURLcode ftp_do_more(struct connectdata *conn, int *completep)
/* if the second connection isn't done yet, wait for it */
if(!conn->bits.tcpconnect[SECONDARYSOCKET]) {
- if(conn->tunnel_state[SECONDARYSOCKET] == TUNNEL_CONNECT) {
+ if(Curl_connect_ongoing(conn)) {
/* As we're in TUNNEL_CONNECT state now, we know the proxy name and port
aren't used so we blank their arguments. TODO: make this nicer */
result = Curl_proxyCONNECT(conn, SECONDARYSOCKET, NULL, 0);
@@ -3617,7 +3616,7 @@ static CURLcode ftp_do_more(struct connectdata *conn, int *completep)
return result;
if(conn->bits.tunnel_proxy && conn->bits.httpproxy &&
- conn->tunnel_state[SECONDARYSOCKET] != TUNNEL_COMPLETE)
+ Curl_connect_ongoing(conn))
return result;