aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/url.c b/lib/url.c
index 50390108f..968421079 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -269,29 +269,31 @@ CURLcode Curl_close(struct SessionHandle *data)
the multi handle, since that function uses the magic
field! */
- if(data->state.connc && (data->state.connc->type == CONNCACHE_PRIVATE)) {
- /* close all connections still alive that are in the private connection
- cache, as we no longer have the pointer left to the shared one. */
- close_connections(data);
+ if(data->state.connc) {
- /* free the connection cache if allocated privately */
- Curl_rm_connc(data->state.connc);
- }
+ if(data->state.connc->type == CONNCACHE_PRIVATE) {
+ /* close all connections still alive that are in the private connection
+ cache, as we no longer have the pointer left to the shared one. */
+ close_connections(data);
- if ( ! (data->share && data->share->hostcache) ) {
- if ( !Curl_global_host_cache_use(data)) {
- Curl_hash_destroy(data->dns.hostcache);
+ /* free the connection cache if allocated privately */
+ Curl_rm_connc(data->state.connc);
}
}
if(data->state.shared_conn) {
- /* this handle is still being used by a shared connection cache and thus
- we leave it around for now */
- Curl_multi_add_closure(data->state.shared_conn, data);
-
+ /* marked to be used by a pending connection so we can't kill this handle
+ just yet */
+ data->state.closed = TRUE;
return CURLE_OK;
}
+ if ( ! (data->share && data->share->hostcache) ) {
+ if ( !Curl_global_host_cache_use(data)) {
+ Curl_hash_destroy(data->dns.hostcache);
+ }
+ }
+
/* Free the pathbuffer */
Curl_safefree(data->reqdata.pathbuffer);
Curl_safefree(data->reqdata.proto.generic);