]> granicus.if.org Git - curl/commitdiff
DNS cache must use the multi DNS cache if the easy handle's one is not using anyone...
authorYang Tse <yangsita@gmail.com>
Mon, 10 Jul 2006 16:14:36 +0000 (16:14 +0000)
committerYang Tse <yangsita@gmail.com>
Mon, 10 Jul 2006 16:14:36 +0000 (16:14 +0000)
lib/multi.c

index 5f98c2eaf42296d03364940aa4f9b6081fdaa304..c59145414f09e9e47c2423a48a65da2c6de54d03 100644 (file)
@@ -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;
   }