void Curl_global_host_cache_dtor(void) { if (host_cache_initialized) { Curl_hash_clean(&hostname_cache); host_cache_initialized = 0; } }
void Curl_hash_destroy(struct curl_hash *h) { if (!h) return; Curl_hash_clean(h); free(h); }
void Curl_hostcache_clean(struct SessionHandle *data, struct curl_hash *hash) { if(data && data->share) Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); Curl_hash_clean(hash); if(data && data->share) Curl_share_unlock(data, CURL_LOCK_DATA_DNS); }
/* * Destroy and cleanup the global DNS cache */ void Curl_global_host_cache_dtor(void) { if(host_cache_initialized) { /* first make sure that any custom "CURLOPT_RESOLVE" names are cleared off */ Curl_hostcache_clean(NULL, &hostname_cache); /* then free the remaining hash completely */ Curl_hash_clean(&hostname_cache); host_cache_initialized = 0; } }
void Curl_conncache_destroy(struct conncache *connc) { if(connc) Curl_hash_clean(&connc->hash); }