From: Bert Hubert Date: Wed, 29 Mar 2006 18:38:16 +0000 (+0000) Subject: it is probable we plough through the cache too much - add simple check to prevent... X-Git-Tag: rec-3-0~109 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7004b0d50ad4b70f6aaccf66a09f5618a9bac987;p=pdns it is probable we plough through the cache too much - add simple check to prevent *lowering* ttds uncessarily, which should leave the cache alone a bit more git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@644 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/recursor_cache.cc b/pdns/recursor_cache.cc index 7483e10c6..686f0e541 100644 --- a/pdns/recursor_cache.cc +++ b/pdns/recursor_cache.cc @@ -132,8 +132,10 @@ void MemRecursorCache::replace(const string &qname, const QType& qt, const set< range=equal_range(ce.d_records.begin(), ce.d_records.end(), dr); if(range.first != range.second) { - for(vector::iterator j=range.first ; j!=range.second; ++j) - j->d_ttd=i->ttl; + for(vector::iterator j=range.first ; j!=range.second; ++j) { + if(i->ttl > j->d_ttd) + j->d_ttd=i->ttl; + } } else { ce.d_records.push_back(dr);