From: Daniel Stenberg Date: Fri, 27 Aug 2021 15:42:40 +0000 (+0200) Subject: http_proxy: only wait for writable socket while sending request X-Git-Tag: curl-7_79_0~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fee6c644fd9f807fcbe690ccf1c2617a78dfe93;p=thirdparty%2Fcurl.git http_proxy: only wait for writable socket while sending request Otherwise it would wait socket writability even after the entire CONNECT request has sent and make curl basically busy-loop while waiting for a response to come back. The previous fix attempt in #7484 (c27a70a591a4) was inadequate. Reported-by: zloi-user on github Reported-by: Oleguer Llopart Fixes #7589 Closes #7647 --- diff --git a/lib/http_proxy.c b/lib/http_proxy.c index 9ce5ee8480..c4fba9d062 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -148,7 +148,7 @@ int Curl_connect_getsock(struct connectdata *conn) DEBUGASSERT(conn->connect_state); http = &conn->connect_state->http_proxy; - if(http->sending) + if(http->sending == HTTPSEND_REQUEST) return GETSOCK_WRITESOCK(0); return GETSOCK_READSOCK(0);