Changeset 843 for trunk/pdns/pdns/pdns_recursor.cc
- Timestamp:
- 05/24/06 00:41:04 (7 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/pdns_recursor.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/pdns_recursor.cc
r838 r843 284 284 /* these two functions are used by LWRes */ 285 285 // -2 is OS error, -1 is error that depends on the remote, > 0 is success 286 int asendto(const char *data, int len, int flags, const ComboAddress& toaddr, uint16_t id, const string& domain, int* fd) 286 int asendto(const char *data, int len, int flags, 287 const ComboAddress& toaddr, uint16_t id, const string& domain, uint16_t qtype, int* fd) 287 288 { 288 289 289 290 PacketID pident; 290 pident.domain=domain; 291 pident.remote=toaddr; 291 pident.domain = domain; 292 pident.remote = toaddr; 293 pident.type = qtype; 292 294 293 295 // see if there is an existing outstanding request we can chain on to, using partial equivalence function … … 325 327 326 328 // -1 is error, 0 is timeout, 1 is success 327 int arecvfrom(char *data, int len, int flags, const ComboAddress& fromaddr, int *d_len, uint16_t id, const string& domain, int fd) 329 int arecvfrom(char *data, int len, int flags, const ComboAddress& fromaddr, int *d_len, 330 uint16_t id, const string& domain, uint16_t qtype, int fd) 328 331 { 329 332 static optional<unsigned int> nearMissLimit; … … 335 338 pident.id=id; 336 339 pident.domain=domain; 340 pident.type = qtype; 337 341 pident.remote=fromaddr; 338 342 … … 993 997 ; 994 998 995 string questionExpand(const char* packet, uint16_t len) 996 { 999 string questionExpand(const char* packet, uint16_t len, uint16_t& type) 1000 { 1001 type=0; 997 1002 const char* end=packet+len; 998 1003 const char* pos=packet+12; … … 1009 1014 if(ret.empty()) 1010 1015 ret="."; 1016 1017 if(pos + labellen + 2 <= end) // is this correct XXX FIXME? 1018 type=(*pos)*256 + *(pos+1); 1019 1011 1020 return ret; 1012 1021 } … … 1141 1150 pident.id=dh.id; 1142 1151 pident.fd=fd; 1143 pident.domain=questionExpand(data, len ); // don't copy this from above - we need to do the actual read1152 pident.domain=questionExpand(data, len, pident.type); // don't copy this from above - we need to do the actual read 1144 1153 string packet; 1145 1154 packet.assign(data, len); … … 1156 1165 1157 1166 for(MT_t::waiters_t::iterator mthread=MT->d_waiters.begin(); mthread!=MT->d_waiters.end(); ++mthread) { 1158 if(pident.fd==mthread->key.fd && mthread->key.remote==pident.remote && 1167 if(pident.fd==mthread->key.fd && mthread->key.remote==pident.remote && mthread->key.type == pident.type && 1159 1168 !Utility::strcasecmp(pident.domain.c_str(), mthread->key.domain.c_str())) { 1160 1169 mthread->key.nearMisses++;