From 56f17d2c9f3d229d701bcf0dda83f4d29c0e02ba Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 15 Jan 2008 22:15:55 +0000 Subject: I made the torture test on test 530 go through. This was actually due to silly code left from when we switched to let the multi handle "hold" the dns cache when using the multi interface... Of course this only triggered when a certain function call returned error at the correct moment. --- lib/url.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/url.c') diff --git a/lib/url.c b/lib/url.c index a5e4565ad..94c363fc2 100644 --- a/lib/url.c +++ b/lib/url.c @@ -457,11 +457,8 @@ CURLcode Curl_close(struct SessionHandle *data) return CURLE_OK; } - if( ! (data->share && data->share->hostcache) ) { - if( !Curl_global_host_cache_use(data)) { - Curl_hash_destroy(data->dns.hostcache); - } - } + if(data->dns.hostcachetype == HCACHE_PRIVATE) + Curl_hash_destroy(data->dns.hostcache); if(data->state.rangestringalloc) free(data->state.range); @@ -782,10 +779,13 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, case CURLOPT_DNS_USE_GLOBAL_CACHE: { long use_cache = va_arg(param, long); - if(use_cache) + if(use_cache) { Curl_global_host_cache_init(); - - data->set.global_dns_cache = (bool)(0 != use_cache); + data->dns.hostcachetype = HCACHE_GLOBAL; + } + else + /* not global makes it private by default then */ + data->dns.hostcachetype = HCACHE_PRIVATE; } break; case CURLOPT_SSL_CIPHER_LIST: -- cgit v1.2.3