Skip to content

Commit

Permalink
and add support for not query-caching scopemasked answers
Browse files Browse the repository at this point in the history
  • Loading branch information
ahupowerdns committed May 29, 2013
1 parent 606018f commit ee5e175
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pdns/ueberbackend.cc
Expand Up @@ -347,6 +347,7 @@ void UeberBackend::addNegCache(const Question &q)
static int negqueryttl=::arg().asNum("negquery-cache-ttl"); static int negqueryttl=::arg().asNum("negquery-cache-ttl");
if(!negqueryttl) if(!negqueryttl)
return; return;
// we should also not be storing negative answers if a pipebackend does scopeMask, but we can't pass a negative scopeMask in an empty set!
PC.insert(q.qname, q.qtype, PacketCache::QUERYCACHE, "", negqueryttl, q.zoneId); PC.insert(q.qname, q.qtype, PacketCache::QUERYCACHE, "", negqueryttl, q.zoneId);
} }


Expand All @@ -367,6 +368,8 @@ void UeberBackend::addCache(const Question &q, const vector<DNSResourceRecord> &
BOOST_FOREACH(DNSResourceRecord rr, rrs) { BOOST_FOREACH(DNSResourceRecord rr, rrs) {
if (rr.ttl < queryttl) if (rr.ttl < queryttl)
cachettl = rr.ttl; cachettl = rr.ttl;
if (rr.scopeMask)
return;
} }


boa << rrs; boa << rrs;
Expand Down

0 comments on commit ee5e175

Please sign in to comment.