Changeset 1285
- Timestamp:
- 11/15/08 23:48:38 (2 months ago)
- Files:
-
- trunk/pdns/pdns/common_startup.cc (modified) (1 diff)
- trunk/pdns/pdns/packetcache.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pdns/pdns/common_startup.cc
r1284 r1285 245 245 S.ringAccount("remotes",P->getRemote()); 246 246 247 if((P->d.opcode != Opcode::Notify) && P->couldBeCached() && PC.get(P, &cached)) { // short circuit - does the PacketCache recognize this question?247 if((P->d.opcode != Opcode::Notify) && P->couldBeCached() && PC.get(P, &cached)) { // short circuit - does the PacketCache recognize this question? 248 248 cached.setRemote(&P->remote); // inlined 249 249 cached.setSocket(P->getSocket()); // inlined trunk/pdns/pdns/packetcache.cc
r1284 r1285 69 69 70 70 bool packetMeritsRecursion=d_doRecursion && p->d.rd; 71 72 71 if(ntohs(p->d.qdcount)!=1) // we get confused by packets with more than one question 73 72 return 0; … … 86 85 87 86 if(getEntry(p->qdomain, p->qtype, PacketCache::PACKETCACHE, value, -1, packetMeritsRecursion)) { 88 // cerr<<"Packet cache hit !"<<endl;87 // cerr<<"Packet cache hit for '"<<p->qdomain<<"', merits: "<<packetMeritsRecursion<<endl; 89 88 (*d_statnumhit)++; 90 89 d_hit++; … … 96 95 } 97 96 } 98 // cerr<<"Packet cache miss"<<endl;97 // cerr<<"Packet cache miss for '"<<p->qdomain<<"', merits: "<<packetMeritsRecursion<<endl; 99 98 (*d_statnummiss)++; 100 99 d_miss++; … … 122 121 bool packetMeritsRecursion=d_doRecursion && q->d.rd; 123 122 124 insert(q->qdomain, q->qtype, PacketCache::PACKETCACHE, r->getString(), packetMeritsRecursion ? d_recursivettl : d_ttl, packetMeritsRecursion);123 insert(q->qdomain, q->qtype, PacketCache::PACKETCACHE, r->getString(), packetMeritsRecursion ? d_recursivettl : d_ttl, -1, packetMeritsRecursion); 125 124 } 126 125 … … 132 131 133 132 // cerr<<"Inserting qname '"<<qname<<"', cet: "<<(int)cet<<", value: '"<< (cet ? value : "PACKET") <<"', qtype: "<<qtype.getName()<<", ttl: "<<ttl<<endl; 134 135 133 CacheEntry val; 136 134 val.ttd=time(0)+ttl;