summaryrefslogtreecommitdiff
path: root/lib/hostip.c
diff options
context:
space:
mode:
authorRomulo A. Ceccon <romuloceccon@gmail.com>2014-01-28 11:59:14 -0200
committerDaniel Stenberg <daniel@haxx.se>2014-01-28 22:25:48 +0100
commit31860ab8c83b35b21f331c85e4535b08b13dc8f9 (patch)
treebe52aab021bcc89f4927a0f5a8bdec6c6046d1a9 /lib/hostip.c
parent2070a140fdb15e9d199f5c42867311f958d1c722 (diff)
downloadcurl-31860ab8c83b35b21f331c85e4535b08b13dc8f9.tar.gz
hostip: don't remove DNS entries that are in use
hostcache_timestamp_remove() should remove old *unused* entries from the host cache, but it never checked whether the entry was actually in use. This complements commit 030a2b8cb. Bug: http://curl.haxx.se/bug/view.cgi?id=1327
Diffstat (limited to 'lib/hostip.c')
-rw-r--r--lib/hostip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 5837e64c7..61d238acd 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -237,7 +237,7 @@ hostcache_timestamp_remove(void *datap, void *hc)
(struct hostcache_prune_data *) datap;
struct Curl_dns_entry *c = (struct Curl_dns_entry *) hc;
- return (data->now - c->timestamp >= data->cache_timeout);
+ return !c->inuse && (data->now - c->timestamp >= data->cache_timeout);
}
/*