From: Bert Hubert Date: Wed, 21 Apr 2010 09:32:07 +0000 (+0000) Subject: prepare pdns_recursor for better nxdomaincache cleaning X-Git-Tag: rec-3.3~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=662b25be4f6c1a3fd0e3ebb2e41465b8fbb2c314;p=pdns prepare pdns_recursor for better nxdomaincache cleaning git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1559 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index fb4fe0431..ac9d7d44d 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1090,11 +1090,12 @@ try t_RC->doPrune(); // this function is local to a thread, so fine anyhow t_packetCache->doPruneTo(::arg().asNum("max-packetcache-entries") / g_numThreads); - typedef SyncRes::negcache_t::nth_index<1>::type negcache_by_ttd_index_t; - negcache_by_ttd_index_t& ttdindex=boost::multi_index::get<1>(t_sstorage->negcache); - - negcache_by_ttd_index_t::iterator i=ttdindex.lower_bound(now.tv_sec); - ttdindex.erase(ttdindex.begin(), i); + { + typedef SyncRes::negcache_t::nth_index<1>::type negcache_by_ttd_index_t; + negcache_by_ttd_index_t& ttdindex=boost::multi_index::get<1>(t_sstorage->negcache); + negcache_by_ttd_index_t::iterator i=ttdindex.lower_bound(now.tv_sec); + ttdindex.erase(ttdindex.begin(), i); + } if(!((cleanCounter++)%40)) { // this is a full scan! time_t limit=now.tv_sec-300;