diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-01-15 22:15:55 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-01-15 22:15:55 +0000 |
commit | 56f17d2c9f3d229d701bcf0dda83f4d29c0e02ba (patch) | |
tree | da73dc3c74a6b29c4c0894a15aa263a88a7fd31a /lib/url.c | |
parent | 19ae96f4d0086f45705a6d4e106e1f66ab03baf7 (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.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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: |