summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dns.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index b7bdbca4e..844077cf4 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -269,7 +269,9 @@ void DNS::Rehash()
/* Rehash the cache */
dnscache* newcache = new dnscache();
for (dnscache::iterator i = this->cache->begin(); i != this->cache->end(); i++)
- newcache->insert(*i);
+ /* Dont include expired items (theres no point) */
+ if (i->second.CalcTTLRemaining())
+ newcache->insert(*i);
delete this->cache;
this->cache = newcache;