From: Yang Tse Date: Mon, 10 Jul 2006 16:14:36 +0000 (+0000) Subject: DNS cache must use the multi DNS cache if the easy handle's one is not using anyone... X-Git-Tag: curl-7_15_5~120 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34f5e8ad0ed29d4dd7c59768339e37c9be2e533a;p=curl DNS cache must use the multi DNS cache if the easy handle's one is not using anyone in curl_multi_add_handle. --- diff --git a/lib/multi.c b/lib/multi.c index 5f98c2eaf..c59145414 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -322,6 +322,12 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle, if (easy->easy_handle->dns.hostcache && (easy->easy_handle->dns.hostcachetype == HCACHE_PRIVATE)) { Curl_hash_destroy(easy->easy_handle->dns.hostcache); + easy->easy_handle->dns.hostcache = NULL; + easy->easy_handle->dns.hostcachetype = HCACHE_NONE; + } + + if (!easy->easy_handle->dns.hostcache || + (easy->easy_handle->dns.hostcachetype == HCACHE_NONE)) { easy->easy_handle->dns.hostcache = multi->hostcache; easy->easy_handle->dns.hostcachetype = HCACHE_MULTI; }