From 32eddae1b56bbd5f3e5921cbe10897f6ed76dde4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Jun 2017 23:02:26 +0200 Subject: 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. --- lib/ftp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/ftp.c') 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; -- cgit v1.2.1