From: Chris Paulson-Ellis Date: Sat, 29 Aug 2020 17:26:50 +0000 (+0100) Subject: conn: check for connection being dead before reuse X-Git-Tag: curl-7_73_0~177 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=728f8d3bdc336e3fa838f45cad6c0133a6b604ae;p=thirdparty%2Fcurl.git 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 #5884 Closes #5893 --- diff --git a/lib/url.c b/lib/url.c index 48b08d7fcd..8a7114a238 100644 --- a/lib/url.c +++ b/lib/url.c @@ -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);