]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
implement wiping of the negative query cache, plus document it. suggested by simon...
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 17 Jun 2008 21:33:18 +0000 (21:33 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 17 Jun 2008 21:33:18 +0000 (21:33 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1204 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/docs/pdns.sgml
pdns/rec_channel_rec.cc

index 8e53246bf52d018aa8c367e2804170233ddb4b3c..b096e4a389a832b83824dc28caa9f5a73f778b91 100644 (file)
              Sten Spans spotted that for outgoing TCP/IP queries, the <command>query-local-address</command> setting was not honored. Fixed in c1190.
            </para>
          </listitem>
+         <listitem>
+           <para>
+             <command>rec_control wipe-cache</command> now also wipes domains from the negative cache, hurrying up the expiry
+             of negatively cached records. Suggested by Simon Kirby, implemented in c1204.
+           </para>
+         </listitem>
+
          <listitem>
            <para>
              Marcus Rueckert of OpenSUSE reported that very recent gcc versions emitted a (correct) warning on an overly complicated line
index 5b5ea02b51c5ca51650f2b35b1440766f19c38bd..c33088c9c1443b88881b0193170a465ea90e6f91 100644 (file)
@@ -90,11 +90,16 @@ string doDumpCache(T begin, T end)
 template<typename T>
 string doWipeCache(T begin, T end)
 {
-  int count=0;
-  for(T i=begin; i != end; ++i)
+  int count=0, countNeg=0;
+  for(T i=begin; i != end; ++i) {
     count+=RC.doWipeCache(toCanonic("", *i));
+    string canon=toCanonic("", *i);
+    countNeg+=SyncRes::s_negcache.count(tie(canon));
+    pair<SyncRes::negcache_t::iterator, SyncRes::negcache_t::iterator> range=SyncRes::s_negcache.equal_range(tie(canon));
+    SyncRes::s_negcache.erase(range.first, range.second);
+  }
 
-  return "wiped "+lexical_cast<string>(count)+" records\n";
+  return "wiped "+lexical_cast<string>(count)+" records, "+lexical_cast<string>(countNeg)+" negative records\n";
 }
 
 template<typename T>