/* Library-wide function for pruning the DNS cache. This function takes and returns the appropriate locks.  */
void Curl_hostcache_prune(struct Curl_easy *data)
/* Library-wide function for pruning the DNS cache. This function takes and returns the appropriate locks.  */
void Curl_hostcache_prune(struct Curl_easy *data)
{
  time_t now;
  if((data->set.dns_cache_timeout == -1) || !data->dns.hostcache)
    return;
  if(data->share)
    Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
  time(&now);
  hostcache_prune(data->dns.hostcache,
                  data->set.dns_cache_timeout,
                  now);
  if(data->share)
    Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
}