From 991505e077f4ecdbd0b1d0f42be0c9b548dc743d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 15 Jan 2008 22:44:12 +0000 Subject: Woops, partly revert my previous commit and do it slightly differently instead. The signalling of that a global DNS cache is wanted is done by setting the option but the setting of the internal variable that it is in use must not be done until it finally actually gets used! NOTE and WARNING: I noticed that you can't actually switch off the global dns cache with CURLOPT_DNS_USE_GLOBAL_CACHE but you couldn't do that previously either and the option is very clearly and loudly documented as DO NOTE USE so I won't bother to fix this bug now. --- lib/url.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index 94c363fc2..83ebcfefa 100644 --- a/lib/url.c +++ b/lib/url.c @@ -778,14 +778,9 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, break; case CURLOPT_DNS_USE_GLOBAL_CACHE: { + /* remember we want this enabled */ long use_cache = va_arg(param, long); - if(use_cache) { - Curl_global_host_cache_init(); - data->dns.hostcachetype = HCACHE_GLOBAL; - } - else - /* not global makes it private by default then */ - data->dns.hostcachetype = HCACHE_PRIVATE; + data->set.global_dns_cache = (bool)(0 != use_cache); } break; case CURLOPT_SSL_CIPHER_LIST: -- cgit v1.2.3