]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Mark Zealey noted that RRs with low TTLs could lower our query-cache-ttl persistently...
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 7 Jan 2013 12:22:23 +0000 (12:22 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 7 Jan 2013 12:22:23 +0000 (12:22 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@3023 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/ueberbackend.cc

index 0ba3eb4ac9dc64d338becbb3a3b60f83a3315f95..4f73028ff4ad70660ebe8fb5a3eb4bc55c41d887 100644 (file)
@@ -354,6 +354,8 @@ void UeberBackend::addCache(const Question &q, const vector<DNSResourceRecord> &
 {
   extern PacketCache PC;
   static unsigned int queryttl=::arg().asNum("query-cache-ttl");
+  unsigned int cachettl;
+
   if(!queryttl)
     return;
   
@@ -361,13 +363,14 @@ void UeberBackend::addCache(const Question &q, const vector<DNSResourceRecord> &
   std::ostringstream ostr;
   boost::archive::binary_oarchive boa(ostr, boost::archive::no_header);
 
+  cachettl = queryttl;
   BOOST_FOREACH(DNSResourceRecord rr, rrs) {
     if (rr.ttl < queryttl)
-      queryttl = rr.ttl;
+      cachettl = rr.ttl;
   }
-  
+
   boa << rrs;
-  PC.insert(q.qname, q.qtype, PacketCache::QUERYCACHE, ostr.str(), queryttl, q.zoneId);
+  PC.insert(q.qname, q.qtype, PacketCache::QUERYCACHE, ostr.str(), cachettl, q.zoneId);
 }
 
 void UeberBackend::alsoNotifies(const string &domain, set<string> *ips)