]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http_proxy: only wait for writable socket while sending request
authorDaniel Stenberg <daniel@haxx.se>
Fri, 27 Aug 2021 15:42:40 +0000 (17:42 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 27 Aug 2021 21:34:37 +0000 (23:34 +0200)
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

lib/http_proxy.c

index 9ce5ee8480506bd9a77bae656ccefdb502172272..c4fba9d0622f86316f98b2da5488202d28f59810 100644 (file)
@@ -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);