diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-05-06 13:04:03 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-05-08 10:49:16 +0200 |
commit | 51c0ebcff2140c38ff389b4fcfb8216f5e9d198c (patch) | |
tree | e4d6c1b35c99cae1e2fe054e1bab69bae07e33f7 /lib/multi.c | |
parent | 63813a0325adec659bdb6866c061208266b68797 (diff) | |
download | curl-51c0ebcff2140c38ff389b4fcfb8216f5e9d198c.tar.gz |
http: deal with partial CONNECT sends
Also added 'CURL_SMALLSENDS' to make Curl_write() send short packets,
which helped verifying this even more.
Add test 363 to verify.
Reported-by: ustcqidi on github
Fixes #6950
Closes #7024
Diffstat (limited to 'lib/multi.c')
-rw-r--r-- | lib/multi.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/multi.c b/lib/multi.c index 205045461..f7b1da9ab 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -936,10 +936,8 @@ static int waitproxyconnect_getsock(struct connectdata *conn, { sock[0] = conn->sock[FIRSTSOCKET]; - /* 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->connect_state) - return GETSOCK_READSOCK(0); + return Curl_connect_getsock(conn); return GETSOCK_WRITESOCK(0); } @@ -1111,11 +1109,11 @@ static CURLMcode multi_wait(struct Curl_multi *multi, for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++) { curl_socket_t s = CURL_SOCKET_BAD; - if(bitmap & GETSOCK_READSOCK(i)) { + if((bitmap & GETSOCK_READSOCK(i)) && VALID_SOCK((sockbunch[i]))) { ++nfds; s = sockbunch[i]; } - if(bitmap & GETSOCK_WRITESOCK(i)) { + if((bitmap & GETSOCK_WRITESOCK(i)) && VALID_SOCK((sockbunch[i]))) { ++nfds; s = sockbunch[i]; } |