conn: always set bits.close with connclose()

Closes #4690
This commit is contained in:
Daniel Stenberg 2019-12-09 12:03:05 +01:00
parent 35c7aac3c6
commit c7bc689fc3
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 4 additions and 3 deletions

View File

@ -58,8 +58,9 @@ static CURLcode https_proxy_connect(struct connectdata *conn, int sockindex)
Curl_ssl_connect_nonblocking(conn, sockindex,
&conn->bits.proxy_ssl_connected[sockindex]);
if(result)
conn->bits.close = TRUE; /* a failed connection is marked for closure to
prevent (bad) re-use or similar */
/* a failed connection is marked for closure to prevent (bad) re-use or
similar */
connclose(conn, "TLS handshake failed");
}
return result;
#else

View File

@ -639,7 +639,7 @@ static CURLcode multi_done(struct Curl_easy *data,
) || conn->bits.close
|| (premature && !(conn->handler->flags & PROTOPT_STREAM))) {
CURLcode res2;
conn->bits.close = TRUE; /* forcibly prevents reuse */
connclose(conn, "disconnecting");
CONN_UNLOCK(data);
res2 = Curl_disconnect(data, conn, premature);