Changeset 1262
- Timestamp:
- 08/24/08 18:28:52 (2 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/recursor_cache.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/recursor_cache.cc
r1182 r1262 43 43 rr.qname=qname; 44 44 45 if(rr.qtype.getCode()==QType::A ) {45 if(rr.qtype.getCode()==QType::A && serial.size()==4) { 46 46 uint32_t ip; 47 47 memcpy((char*)&ip, serial.c_str(), 4); 48 48 rr.content=U32ToIP(ntohl(ip)); 49 } 50 else if(rr.qtype.getCode()==QType::AAAA && serial.size()==16) { 51 ComboAddress tmp; 52 tmp.sin4.sin_family=AF_INET6; 53 memcpy(tmp.sin6.sin6_addr.s6_addr, serial.c_str(), 16); 54 rr.content=tmp.toString(); 49 55 } 50 56 else if(rr.qtype.getCode()==QType::CNAME || rr.qtype.getCode()==QType::NS || rr.qtype.getCode()==QType::PTR) { … … 85 91 IpToU32(rr.content, &ip); 86 92 return string((char*)&ip, 4); 93 } 94 else if(type==QType::AAAA) { 95 ComboAddress ca(rr.content); 96 return string((char*)&ca.sin6.sin6_addr.s6_addr, 16); 87 97 } 88 98 else if(type==QType::NS || type==QType::CNAME) … … 325 335 } 326 336 } 337 327 338 if(isNew) { 328 339 sort(ce.d_records.begin(), ce.d_records.end()); 329 340 } 330 341 331 342 if(ce.d_records.capacity() != ce.d_records.size()) 332 343 vector<StoredRecord>(ce.d_records).swap(ce.d_records); 333 344 334 345 d_cache.replace(stored, ce); 335 346 }