]> granicus.if.org Git - pdns/commitdiff
it is probable we plough through the cache too much - add simple check to prevent...
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 29 Mar 2006 18:38:16 +0000 (18:38 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 29 Mar 2006 18:38:16 +0000 (18:38 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@644 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/recursor_cache.cc

index 7483e10c6cc4a76f8941b7f1be514c69358931c1..686f0e541b3009cdfb7eeb5c034c257abf025857 100644 (file)
@@ -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<StoredRecord>::iterator j=range.first ; j!=range.second; ++j)
-         j->d_ttd=i->ttl;
+       for(vector<StoredRecord>::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);