mirror of
https://github.com/curl/curl.git
synced 2026-08-02 21:30:28 +03:00
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
This commit is contained in:
parent
63813a0325
commit
51c0ebcff2
8 changed files with 213 additions and 54 deletions
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue