summaryrefslogtreecommitdiff
path: root/lib/hostip.h
diff options
context:
space:
mode:
authorStefan Bühler <buehler@teamviewer.com>2015-03-17 09:09:43 +0100
committerDaniel Stenberg <daniel@haxx.se>2015-04-03 16:46:14 +0200
commit0db831976e4b2d2553c8cd9aaae492970d830f57 (patch)
tree7914cc2feee038d76edc740bffa838fb2ccd6628 /lib/hostip.h
parent369430cd170432446da245ee65d1edabedcd09f5 (diff)
downloadcurl-0db831976e4b2d2553c8cd9aaae492970d830f57.tar.gz
fix refreshing of obsolete dns cache entries
- cache entries must be also refreshed when they are in use - have the cache count as inuse reference too, freeing timestamp == 0 special value - use timestamp == 0 for CURLOPT_RESOLVE entries which don't get refreshed - remove CURLOPT_RESOLVE special inuse reference (timestamp == 0 will prevent refresh) - fix Curl_hostcache_clean - CURLOPT_RESOLVE entries don't have a special reference anymore, and it would also release non CURLOPT_RESOLVE references - fix locking in Curl_hostcache_clean - fix unit1305.c: hash now keeps a reference, need to set inuse = 1
Diffstat (limited to 'lib/hostip.h')
-rw-r--r--lib/hostip.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/hostip.h b/lib/hostip.h
index e1e880eab..0e2e2cf7f 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;
};
/*