1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

vtls: set conn->data when closing TLS

Follow-up to 1b76c38904. The VTLS backends that close down the TLS
layer for a connection still needs a Curl_easy handle for the session_id
cache etc.

Fixes #2764
Closes #2771
This commit is contained in:
Daniel Stenberg 2018-07-20 23:24:47 +02:00
parent 6d13432bfa
commit 81377cace6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 4 additions and 1 deletions

View File

@ -314,7 +314,6 @@ void Curl_conncache_remove_conn(struct connectdata *conn, bool lock)
if(lock) {
CONN_LOCK(data);
}
conn->data = NULL; /* detach */
bundle_remove_conn(bundle, conn);
if(bundle->num_connections == 0)
conncache_remove_bundle(connc, bundle);

View File

@ -788,6 +788,9 @@ CURLcode Curl_disconnect(struct Curl_easy *data,
free_fixed_hostname(&conn->http_proxy.host);
free_fixed_hostname(&conn->socks_proxy.host);
DEBUGASSERT(conn->data == data);
/* this assumes that the pointer is still there after the connection was
detected from the cache */
Curl_ssl_close(conn, FIRSTSOCKET);
conn_free(conn);
@ -969,6 +972,7 @@ static bool extract_if_dead(struct connectdata *conn,
if(dead) {
infof(data, "Connection %ld seems to be dead!\n", conn->connection_id);
Curl_conncache_remove_conn(conn, FALSE);
conn->data = NULL; /* detach */
return TRUE;
}
}