Lines Matching refs:dns
265 if((data->set.dns_cache_timeout == -1) || !data->dns.hostcache) in Curl_hostcache_prune()
276 hostcache_prune(data->dns.hostcache, in Curl_hostcache_prune()
297 struct Curl_dns_entry *dns = NULL; in fetch_addr() local
307 dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1); in fetch_addr()
310 if(!dns && data->change.wildcard_resolve) { in fetch_addr()
315 dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1); in fetch_addr()
318 if(dns && (data->set.dns_cache_timeout != -1)) { in fetch_addr()
325 if(hostcache_timestamp_remove(&user, dns)) { in fetch_addr()
327 dns = NULL; /* the memory deallocation is being handled by the hash */ in fetch_addr()
328 Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1); in fetch_addr()
332 return dns; in fetch_addr()
355 struct Curl_dns_entry *dns = NULL; in Curl_fetch_addr() local
360 dns = fetch_addr(conn, hostname, port); in Curl_fetch_addr()
362 if(dns) in Curl_fetch_addr()
363 dns->inuse++; /* we use it! */ in Curl_fetch_addr()
368 return dns; in Curl_fetch_addr()
456 struct Curl_dns_entry *dns; in Curl_cache_addr() local
467 dns = calloc(1, sizeof(struct Curl_dns_entry)); in Curl_cache_addr()
468 if(!dns) { in Curl_cache_addr()
476 dns->inuse = 1; /* the cache has the first reference */ in Curl_cache_addr()
477 dns->addr = addr; /* this is the address(es) */ in Curl_cache_addr()
478 time(&dns->timestamp); in Curl_cache_addr()
479 if(dns->timestamp == 0) in Curl_cache_addr()
480 dns->timestamp = 1; /* zero indicates CURLOPT_RESOLVE entry */ in Curl_cache_addr()
483 dns2 = Curl_hash_add(data->dns.hostcache, entry_id, entry_len + 1, in Curl_cache_addr()
484 (void *)dns); in Curl_cache_addr()
486 free(dns); in Curl_cache_addr()
490 dns = dns2; in Curl_cache_addr()
491 dns->inuse++; /* mark entry as in-use */ in Curl_cache_addr()
492 return dns; in Curl_cache_addr()
521 struct Curl_dns_entry *dns = NULL; in Curl_resolv() local
531 dns = fetch_addr(conn, hostname, port); in Curl_resolv()
533 if(dns) { in Curl_resolv()
535 dns->inuse++; /* we use it! */ in Curl_resolv()
542 if(!dns) { in Curl_resolv()
584 result = Curl_resolv_check(conn, &dns); in Curl_resolv()
587 if(dns) in Curl_resolv()
598 dns = Curl_cache_addr(data, addr, hostname, port); in Curl_resolv()
603 if(!dns) in Curl_resolv()
611 *entry = dns; in Curl_resolv()
809 void Curl_resolv_unlock(struct Curl_easy *data, struct Curl_dns_entry *dns) in Curl_resolv_unlock() argument
814 freednsentry(dns); in Curl_resolv_unlock()
825 struct Curl_dns_entry *dns = (struct Curl_dns_entry *) freethis; in freednsentry() local
826 DEBUGASSERT(dns && (dns->inuse>0)); in freednsentry()
828 dns->inuse--; in freednsentry()
829 if(dns->inuse == 0) { in freednsentry()
830 Curl_freeaddrinfo(dns->addr); in freednsentry()
831 free(dns); in freednsentry()
894 Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1); in Curl_loadhostpairs()
900 struct Curl_dns_entry *dns; in Curl_loadhostpairs() local
1004 dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1); in Curl_loadhostpairs()
1006 if(dns) { in Curl_loadhostpairs()
1016 Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1); in Curl_loadhostpairs()
1020 dns = Curl_cache_addr(data, head, hostname, port); in Curl_loadhostpairs()
1021 if(dns) { in Curl_loadhostpairs()
1022 dns->timestamp = 0; /* mark as added by CURLOPT_RESOLVE */ in Curl_loadhostpairs()
1025 dns->inuse--; in Curl_loadhostpairs()
1031 if(!dns) { in Curl_loadhostpairs()
1052 struct Curl_dns_entry **dns) in Curl_resolv_check() argument
1055 return Curl_doh_is_resolved(conn, dns); in Curl_resolv_check()
1056 return Curl_resolver_is_resolved(conn, dns); in Curl_resolv_check()
1087 if(conn->async.dns) { in Curl_once_resolved()
1088 conn->dns_entry = conn->async.dns; in Curl_once_resolved()
1089 conn->async.dns = NULL; in Curl_once_resolved()