Lines Matching refs:dns

122                               struct Curl_dns_entry *dns);
245 if(!data->dns.hostcache)
256 time_t oldest = hostcache_prune(data->dns.hostcache, timeout, now);
265 } while(timeout && (data->dns.hostcache->size > MAX_DNS_CACHE_SIZE));
284 struct Curl_dns_entry *dns = NULL;
291 /* See if its already in our dns cache */
292 dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1);
295 if(!dns && data->state.wildcard_resolve) {
298 /* See if it's already in our dns cache */
299 dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1);
302 if(dns && (data->set.dns_cache_timeout != -1)) {
310 if(hostcache_timestamp_remove(&user, dns)) {
312 dns = NULL; /* the memory deallocation is being handled by the hash */
313 Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1);
318 if(dns && data->conn->ip_version != CURL_IPRESOLVE_WHATEVER) {
321 struct Curl_addrinfo *addr = dns->addr;
338 dns = NULL; /* the memory deallocation is being handled by the hash */
339 Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1);
342 return dns;
364 struct Curl_dns_entry *dns = NULL;
369 dns = fetch_addr(data, hostname, port);
371 if(dns)
372 dns->inuse++; /* we use it! */
377 return dns;
466 * address, we call this function to store the information in the dns
480 struct Curl_dns_entry *dns;
495 dns = calloc(1, sizeof(struct Curl_dns_entry) + hostlen);
496 if(!dns) {
504 dns->inuse = 1; /* the cache has the first reference */
505 dns->addr = addr; /* this is the address(es) */
506 time(&dns->timestamp);
507 if(dns->timestamp == 0)
508 dns->timestamp = 1; /* zero indicates permanent CURLOPT_RESOLVE entry */
509 dns->hostport = port;
511 memcpy(dns->hostname, hostname, hostlen);
514 dns2 = Curl_hash_add(data->dns.hostcache, entry_id, entry_len + 1,
515 (void *)dns);
517 free(dns);
521 dns = dns2;
522 dns->inuse++; /* mark entry as in-use */
523 return dns;
690 struct Curl_dns_entry *dns = NULL;
712 dns = fetch_addr(data, hostname, port);
714 if(dns) {
716 dns->inuse++; /* we use it! */
723 if(!dns) {
822 result = Curl_resolv_check(data, &dns);
825 if(dns)
836 dns = Curl_cache_addr(data, addr, hostname, 0, port);
841 if(!dns)
846 show_resolve_info(data, dns);
851 *entry = dns;
1051 void Curl_resolv_unlock(struct Curl_easy *data, struct Curl_dns_entry *dns)
1056 freednsentry(dns);
1063 * File-internal: release cache dns entry reference, free if inuse drops to 0
1067 struct Curl_dns_entry *dns = (struct Curl_dns_entry *) freethis;
1068 DEBUGASSERT(dns && (dns->inuse>0));
1070 dns->inuse--;
1071 if(dns->inuse == 0) {
1072 Curl_freeaddrinfo(dns->addr);
1073 free(dns);
1142 Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1);
1148 struct Curl_dns_entry *dns;
1255 /* See if it's already in our dns cache */
1256 dns = Curl_hash_pick(data->dns.hostcache, entry_id, entry_len + 1);
1258 if(dns) {
1272 Curl_hash_delete(data->dns.hostcache, entry_id, entry_len + 1);
1276 dns = Curl_cache_addr(data, head, host_begin, hlen, port);
1277 if(dns) {
1279 dns->timestamp = 0; /* mark as permanent */
1282 dns->inuse--;
1288 if(!dns) {
1312 struct Curl_dns_entry *dns)
1322 DEBUGASSERT(dns);
1326 !dns->hostname[0] || Curl_host_is_ipnum(dns->hostname))
1329 a = dns->addr;
1332 (dns->hostname[0] ? dns->hostname : "(none)"), dns->hostport);
1376 struct Curl_dns_entry **dns)
1381 (void)dns;
1385 result = Curl_doh_is_resolved(data, dns);
1389 result = Curl_resolver_is_resolved(data, dns);
1390 if(*dns)
1391 show_resolve_info(data, *dns);
1424 if(data->state.async.dns) {
1425 conn->dns_entry = data->state.async.dns;
1426 data->state.async.dns = NULL;