Show
Ignore:
Timestamp:
04/05/06 10:17:28 (4 years ago)
Author:
ahu
Message:

sigh - people change their SOA serials a lot these days. PowerDNS tries to store all different SOA records of a domain.
After a few hours you might have as much as 2000 .COM SOA records in your cache, and we try to output them all..

Also, scrounge the cache a bit more for stale entries.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/recursor_cache.cc

    r656 r657  
    138138 
    139139  //  cerr<<"storing "<< toLowerCanonic(qname)+"|"+qt.getName()<<"\n"; 
    140    
     140 
    141141  bool isNew=false; 
    142142  if(stored == d_cache.end()) { 
     
    144144    isNew=true; 
    145145  } 
    146  
     146   
    147147  pair<vector<StoredRecord>::iterator, vector<StoredRecord>::iterator> range; 
    148148 
    149149  StoredRecord dr; 
    150150  CacheEntry ce=*stored; 
     151 
     152  if(qt.getCode()==QType::SOA || qt.getCode()==QType::CNAME)  // you can only have one (1) each of these 
     153    ce.d_records.clear(); 
     154 
    151155 
    152156  for(set<DNSResourceRecord>::const_iterator i=content.begin(); i != content.end(); ++i) { 
     
    239243    lookAt=5*toTrim; 
    240244  else 
    241     lookAt=10000; 
     245    lookAt=0.02 * cacheSize; 
    242246 
    243247