http_proxy/hyper: handle closed connections

Enable test 1021 for hyper builds.

Patched-by: Prithvi MK
Fixes #8700
Closes #8806
This commit is contained in:
Daniel Stenberg 2022-05-06 10:00:24 +02:00
parent a15fa1c357
commit a8a1dd8ecc
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 11 additions and 5 deletions

View File

@ -967,6 +967,13 @@ static CURLcode CONNECT(struct Curl_easy *data,
break; break;
} }
if(conn->bits.close && data->req.newurl) {
/* Connection closed by server. Don't use it anymore */
Curl_closesocket(data, conn, conn->sock[sockindex]);
conn->sock[sockindex] = CURL_SOCKET_BAD;
break;
}
/* If we are supposed to continue and request a new URL, which basically /* If we are supposed to continue and request a new URL, which basically
* means the HTTP authentication is still going on so if the tunnel * means the HTTP authentication is still going on so if the tunnel
* is complete we start over in INIT state */ * is complete we start over in INIT state */

View File

@ -50,7 +50,6 @@
671 671
672 672
673 673
1021
1417 1417
1533 1533
1540 1540