2
0
mirror of https://github.com/curl/curl.git synced 2025-03-13 15:37:04 +08:00

conn: check for connection being dead before reuse

Prevents incorrect reuse of an HTTP connection that has been prematurely
shutdown() by the server.

Partial revert of 755083d00deb16

Fixes 
Closes 
This commit is contained in:
Chris Paulson-Ellis 2020-08-29 18:26:50 +01:00 committed by Daniel Stenberg
parent 8b69ac0c10
commit 728f8d3bdc
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

@ -1120,6 +1120,12 @@ ConnectionExists(struct Curl_easy *data,
/* connect-only or to-be-closed connections will not be reused */
continue;
if(extract_if_dead(check, data)) {
/* disconnect it */
(void)Curl_disconnect(data, check, /* dead_connection */TRUE);
continue;
}
if(bundle->multiuse == BUNDLE_MULTIPLEX)
multiplexed = CONN_INUSE(check);