Commit 34f5e8ad authored by Yang Tse's avatar Yang Tse
Browse files

DNS cache must use the multi DNS cache if the easy handle's one is not using...

DNS cache must use the multi DNS cache if the easy handle's one is not using anyone in curl_multi_add_handle.
parent c2fee989
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;
  }