From 4b75bac97e4bdee5c3ce07e7fa60b3067f9d9f8b Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 8 Jan 2007 00:05:55 +0000 Subject: Oh, this tweak is for w00t -- rehash will remove expired items from the dns cache git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6257 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/dns.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/dns.cpp') 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; -- cgit v1.2.3