X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fdns.cpp;h=3d3bc947fee2cfbee4f045e04b56b5eeb0730687;hb=09c716ce117e3c89b4da7ab88f4caaefb43511b5;hp=ff823524c347f0fad7c865e6fb9fc7df1d960f99;hpb=24438c074648c16fa1adb2a8b2b18d4f8d916214;p=user%2Fhenk%2Fcode%2Finspircd.git 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];