Changeset 934 for trunk/pdns/pdns/recursor_cache.cc
- Timestamp:
- 12/21/06 10:06:46 (6 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/recursor_cache.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/recursor_cache.cc
r931 r934 5 5 #include "dnsrecords.hh" 6 6 #include "arguments.hh" 7 #include "syncres.hh" 7 8 8 9 using namespace std; … … 146 147 { 147 148 if(!d_cachecachevalid || Utility::strcasecmp(d_cachedqname.c_str(), qname)) { 148 cerr<<"had cache cache miss for '"<<qname<<"'"<<endl;149 // cerr<<"had cache cache miss for '"<<qname<<"'"<<endl; 149 150 d_cachedqname=qname; 150 151 d_cachecache=d_cache.equal_range(tie(qname)); … … 155 156 // cerr<<"had cache cache hit!"<<endl; 156 157 157 if(d_cachecache.first == d_cachecache.second) 158 if(d_cachecache.first == d_cachecache.second) { 159 g_stats.noShuntNoMatch++; 158 160 return false; 161 } 159 162 160 163 pair<cache_t::iterator, cache_t::iterator> range = d_cachecache; … … 162 165 unsigned int n=0; 163 166 for(;range.first != range.second; ++range.first) { 164 if(range.first->d_qtype == QType::CNAME) // if we see a cname, we need the whole shebang (for now) 167 if(range.first->d_qtype == QType::CNAME) { // if we see a cname, we need the whole shebang (for now) 168 g_stats.noShuntCNAME++; 165 169 return false; 170 } 166 171 if(range.first->d_qtype != qt.getCode()) 167 172 continue; 168 if(range.first->getTTD() < (unsigned int) now) 173 if(range.first->getTTD() < (unsigned int) now) { 174 g_stats.noShuntExpired++; 169 175 return false; 176 } 170 177 171 if(range.first->d_records.empty() || range.first->d_records.size() > 9 ) 178 if(range.first->d_records.empty() || range.first->d_records.size() > 9 ) { 179 g_stats.noShuntSize++; 172 180 return false; 181 } 173 182 174 183 size_t limit=range.first->d_records.size(); … … 190 199 return false; 191 200 } 201 if(!n) 202 g_stats.noShuntNoMatch++; 192 203 return n; 193 204