summaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-10-07 22:00:48 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-10-07 23:54:33 +0200
commit1e552535e1762acd36c930299b46829e58eb1583 (patch)
tree6f047f9587cbd1b552d65aa2926ac58f9db84745 /lib/multi.c
parentf3e03f6c0ac52a1bf396e03f7d7e9b5b3b7165fe (diff)
downloadcurl-1e552535e1762acd36c930299b46829e58eb1583.tar.gz
remove_handle: call multi_done() first, then clear dns cache pointer
Closes #1960
Diffstat (limited to 'lib/multi.c')
-rw-r--r--lib/multi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/multi.c b/lib/multi.c
index ec679ba4a..c87515969 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -711,12 +711,6 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi,
curl_easy_cleanup is called. */
Curl_expire_clear(data);
- if(data->dns.hostcachetype == HCACHE_MULTI) {
- /* stop using the multi handle's DNS cache */
- data->dns.hostcache = NULL;
- data->dns.hostcachetype = HCACHE_NONE;
- }
-
if(data->easy_conn) {
/* we must call multi_done() here (if we still own the connection) so that
@@ -735,6 +729,13 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi,
Curl_getoff_all_pipelines(data, data->easy_conn);
}
+ if(data->dns.hostcachetype == HCACHE_MULTI) {
+ /* stop using the multi handle's DNS cache, *after* the possible
+ multi_done() call above */
+ data->dns.hostcache = NULL;
+ data->dns.hostcachetype = HCACHE_NONE;
+ }
+
Curl_wildcard_dtor(&data->wildcard);
/* destroy the timeout list that is held in the easy handle, do this *after*