]> granicus.if.org Git - pdns/commitdiff
prepare pdns_recursor for better nxdomaincache cleaning
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 21 Apr 2010 09:32:07 +0000 (09:32 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 21 Apr 2010 09:32:07 +0000 (09:32 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1559 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/pdns_recursor.cc

index fb4fe043163ff9b49ce1567c97886c8c38483226..ac9d7d44d21d12ea0bea4f0dc7b4d428d4147bc1 100644 (file)
@@ -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;