diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-08 00:05:55 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-08 00:05:55 +0000 |
commit | 4b75bac97e4bdee5c3ce07e7fa60b3067f9d9f8b (patch) | |
tree | 5894d46ef34f982c0a1cf525e31088bef242a9b4 /src/dns.cpp | |
parent | e82913ed68b6a8f427150213a2d6ee06ad0d7a8f (diff) |
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
Diffstat (limited to 'src/dns.cpp')
-rw-r--r-- | src/dns.cpp | 4 |
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; |