diff options
author | Seonah Moon <seonah1.moon@samsung.com> | 2016-04-07 13:35:45 +0900 |
---|---|---|
committer | Seonah Moon <seonah1.moon@samsung.com> | 2016-04-07 13:43:56 +0900 |
commit | 2bc9d6bb53df44a0c5174767de734620c2cdfd9e (patch) | |
tree | 5f133be6bde9bc9fc0052463887018d5a4a61686 /lib/hostip.h | |
parent | 727561ff7338bff27c3cae5c5f3cbf9c1a3b56e1 (diff) | |
parent | 8a08705db260779441360e959b97b6c172f8acb0 (diff) | |
download | curl-2bc9d6bb53df44a0c5174767de734620c2cdfd9e.tar.gz curl-2bc9d6bb53df44a0c5174767de734620c2cdfd9e.tar.bz2 curl-2bc9d6bb53df44a0c5174767de734620c2cdfd9e.zip |
Update to 7.44.0submit/tizen/20160407.062150
Change-Id: I5b1e06765d1fe3c75597ff7db9831228ea0cad05
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
Diffstat (limited to 'lib/hostip.h')
-rw-r--r-- | lib/hostip.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/hostip.h b/lib/hostip.h index e1e880eab..d5b44bc9e 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -65,11 +65,10 @@ void Curl_global_host_cache_dtor(void); struct Curl_dns_entry { Curl_addrinfo *addr; - /* timestamp == 0 -- entry not in hostcache - timestamp != 0 -- entry is in hostcache */ + /* timestamp == 0 -- CURLOPT_RESOLVE entry, doesn't timeout */ time_t timestamp; - long inuse; /* use-counter, make very sure you decrease this - when you're done using the address you received */ + /* use-counter, use Curl_resolv_unlock to release reference */ + long inuse; }; /* @@ -125,8 +124,8 @@ void Curl_resolv_unlock(struct SessionHandle *data, /* for debugging purposes only: */ void Curl_scan_cache_used(void *user, void *ptr); -/* make a new dns cache and return the handle */ -struct curl_hash *Curl_mk_dnscache(void); +/* init a new dns cache and return success */ +int Curl_mk_dnscache(struct curl_hash *hash); /* prune old entries from the DNS cache */ void Curl_hostcache_prune(struct SessionHandle *data); @@ -175,6 +174,9 @@ const char *Curl_printable_address(const Curl_addrinfo *ip, * 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. + * + * The returned data *MUST* be "unlocked" with Curl_resolv_unlock() after + * use, or we'll leak memory! */ struct Curl_dns_entry * Curl_fetch_addr(struct connectdata *conn, |