aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-01-15 22:15:55 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-01-15 22:15:55 +0000
commit56f17d2c9f3d229d701bcf0dda83f4d29c0e02ba (patch)
treeda73dc3c74a6b29c4c0894a15aa263a88a7fd31a /lib/url.c
parent19ae96f4d0086f45705a6d4e106e1f66ab03baf7 (diff)
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.
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c16
1 files changed, 8 insertions, 8 deletions
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: