From: Bert Hubert Date: Sat, 3 Apr 2010 10:56:57 +0000 (+0000) Subject: fix 'forever refreshing NS records' again, plus potentially solve other weirdness... X-Git-Tag: rec-3.3~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09a6f09728e38b7e53b414628f168c2ade43ea03;p=pdns fix 'forever refreshing NS records' again, plus potentially solve other weirdness with records being erased and replaced git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1548 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/recursor_cache.cc b/pdns/recursor_cache.cc index 54a2125ac..a11f83eb4 100644 --- a/pdns/recursor_cache.cc +++ b/pdns/recursor_cache.cc @@ -158,23 +158,23 @@ int MemRecursorCache::get(time_t now, const string &qname, const QType& qt, set< bool MemRecursorCache::attemptToRefreshNSTTL(const QType& qt, const set& content, const CacheEntry& stored) { if(!stored.d_auth) { -// cerr<<"feel free to scribble non-auth data!"<d_ttd > content.begin()->ttl) { - // cerr<<"attempt to LOWER TTL - fine by us"< '"<content<<"', isnew="< '"<content<<"', isnew="<::const_iterator i=content.begin(); i != content.end(); ++i) { + // cerr<<"To store: "<content<ttl; dr.d_string=DNSRR2String(*i); @@ -240,31 +243,25 @@ void MemRecursorCache::replace(time_t now, const string &qname, const QType& qt, else { range=equal_range(ce.d_records.begin(), ce.d_records.end(), dr); - if(range.first != range.second && (range.first != ce.d_records.begin() || range.second != ce.d_records.end())) { - // cerr<<"\t\tIncomplete match! Must nuke"<::iterator j=range.first ; j!=range.second; ++j) { /* see http://mailman.powerdns.com/pipermail/pdns-users/2006-May/003413.html */ - if(j->d_ttd > (unsigned int) now && i->ttl > j->d_ttd && qt.getCode()==QType::NS && auth) { // don't allow auth servers to *raise* TTL of an NS recor - // cerr<<"\t\tNot doing so, trying to raise TTL NS\n"; + if(j->d_ttd > (unsigned int) now && i->ttl > j->d_ttd && qt.getCode()==QType::NS && auth) { // don't allow auth servers to *raise* TTL of an NS record + //~ cerr<<"\t\tNot doing so, trying to raise TTL NS\n"; continue; } if(i->ttl > j->d_ttd || (auth && d_followRFC2181) ) { // authoritative packets can override the TTL to be lower - // cerr<<"\t\tUpdating the ttl, diff="<d_ttd - i->ttl<ttl - now <ttl - now <