summaryrefslogtreecommitdiff
path: root/src/dns.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dns.cpp')
-rw-r--r--src/dns.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dns.cpp b/src/dns.cpp
index ff823524c..3d3bc947f 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -1060,7 +1060,11 @@ void DNS::HandleEvent(EventType, int)
ServerInstance->stats->statsDnsGood++;
if (!this->GetCache(res.original.c_str()))
+ {
+ if (cache->size() >= MAX_CACHE_SIZE)
+ cache->clear();
this->cache->insert(std::make_pair(res.original.c_str(), CachedQuery(res.result, res.type, res.ttl)));
+ }
Classes[res.id]->OnLookupComplete(res.result, res.ttl, false);
delete Classes[res.id];