aboutsummaryrefslogtreecommitdiff
path: root/lib/hostip.h
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2014-08-20 23:31:53 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-08-31 10:49:40 +0200
commit09b5a99816a24a12f769f61db5f7eafd4bc32795 (patch)
tree1b91304501ae6eed8c832ec140acce4dfceeb4ab /lib/hostip.h
parent2434a4e88de35a0c7eced46f010292e2b4bfb851 (diff)
resolve: cache lookup for async resolvers
While waiting for a host resolve, check if the host cache may have gotten the name already (by someone else), for when the same name is resolved by several simultanoues requests. The resolver thread occasionally gets stuck in getaddrinfo() when the DNS or anything else is crappy or slow, so when a host is found in the DNS cache, leave the thread alone and let itself cleanup the mess.
Diffstat (limited to 'lib/hostip.h')
-rw-r--r--lib/hostip.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/hostip.h b/lib/hostip.h
index 42ed7d320..440465194 100644
--- a/lib/hostip.h
+++ b/lib/hostip.h
@@ -172,6 +172,17 @@ const char *Curl_printable_address(const Curl_addrinfo *ip,
char *buf, size_t bufsize);
/*
+ * Curl_fetch_addr() fetches a 'Curl_dns_entry' already in the DNS cache.
+ *
+ * Returns the Curl_dns_entry entry pointer or NULL if not in the cache.
+ */
+struct Curl_dns_entry *
+Curl_fetch_addr(struct connectdata *conn,
+ const char *hostname,
+ int port,
+ int *stale);
+
+/*
* Curl_cache_addr() stores a 'Curl_addrinfo' struct in the DNS cache.
*
* Returns the Curl_dns_entry entry pointer or NULL if the storage failed.