summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-07-20 23:24:47 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-07-20 23:26:12 +0200
commitbc36c4f5463db6ddb098fe83ec7ae8ead012d01b (patch)
treeee90d5f72d695c68c3aeb3bef863fbfb52f3d77f
parent7b9bc96c7716f34dbd1f525aefb77d74b8b0f528 (diff)
downloadcurl-bagder/vtls-conn-data-TLS-kill.tar.gz
vtls: set conn->data when closing TLSbagder/vtls-conn-data-TLS-kill
Follow-up to 1b76c38904f0. 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
-rw-r--r--lib/conncache.c1
-rw-r--r--lib/url.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/conncache.c b/lib/conncache.c
index 957ced3c7..6fbf3b1d2 100644
--- a/lib/conncache.c
+++ b/lib/conncache.c
@@ -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);
diff --git a/lib/url.c b/lib/url.c
index 48d697b3c..5f520e91e 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -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;
}
}