summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-04-03 23:41:58 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-04-03 23:41:58 +0200
commit81ee1e69fe9fd236e2cc6a9bb392a3ed51edc94a (patch)
treeca1896fec8384cd673c3a722a90ef73153fd7b8b
parent846f4920535461a9f25c412cc2d1e519067e103b (diff)
downloadgnurl-81ee1e69fe9fd236e2cc6a9bb392a3ed51edc94a.tar.gz
gnurl-81ee1e69fe9fd236e2cc6a9bb392a3ed51edc94a.tar.bz2
gnurl-81ee1e69fe9fd236e2cc6a9bb392a3ed51edc94a.zip
hostip: fix compiler warnings
introduced in the previous mini-series of 3 commits
-rw-r--r--lib/hostip.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index aad35cd5c..764e78026 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -277,33 +277,6 @@ void Curl_hostcache_prune(struct SessionHandle *data)
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
}
-/*
- * Check if the entry should be pruned. Assumes a locked cache.
- */
-static int
-remove_entry_if_stale(struct SessionHandle *data, struct Curl_dns_entry *dns)
-{
- struct hostcache_prune_data user;
-
- if(!dns || (data->set.dns_cache_timeout == -1) || !data->dns.hostcache)
- /* cache forever means never prune, and NULL hostcache means we can't do
- it */
- return 0;
-
- time(&user.now);
- user.cache_timeout = data->set.dns_cache_timeout;
-
- if(!hostcache_timestamp_remove(&user, dns) )
- return 0;
-
- Curl_hash_clean_with_criterium(data->dns.hostcache,
- (void *) &user,
- hostcache_timestamp_remove);
-
- return 1;
-}
-
-
#ifdef HAVE_SIGSETJMP
/* Beware this is a global and unique instance. This is used to store the
return address that we can jump back to from inside a signal handler. This
@@ -321,7 +294,6 @@ fetch_addr(struct connectdata *conn,
struct Curl_dns_entry *dns = NULL;
size_t entry_len;
struct SessionHandle *data = conn->data;
- int stale;
/* Create an entry id, based upon the hostname and port */
entry_id = create_hostcache_id(hostname, port);
@@ -777,13 +749,6 @@ struct curl_hash *Curl_mk_dnscache(void)
return Curl_hash_alloc(7, Curl_hash_str, Curl_str_key_compare, freednsentry);
}
-static int free_all_entries(void *data, void *hc)
-{
- (void)data;
- (void)hc;
- return 1; /* free all entries */
-}
-
/*
* Curl_hostcache_clean()
*
@@ -797,7 +762,7 @@ void Curl_hostcache_clean(struct SessionHandle *data,
if(data && data->share)
Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
- Curl_hash_clean_with_criterium(hash, NULL, free_all_entries);
+ Curl_hash_clean(hash);
if(data && data->share)
Curl_share_unlock(data, CURL_LOCK_DATA_DNS);