Changeset 1329
- Timestamp:
- 02/07/09 16:09:11 (4 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/pdns_recursor.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/pdns_recursor.cc
r1319 r1329 1271 1271 1272 1272 len=recvfrom(fd, data, sizeof(data), 0, (sockaddr *)&fromaddr, &addrlen); 1273 // HTimerSentinel hts=s_timer.getSentinel(); 1273 1274 1274 if(len < (int)sizeof(dnsheader)) { 1275 1275 if(len < 0) … … 1296 1296 memcpy(&dh, data, sizeof(dh)); 1297 1297 1298 if(!dh.qdcount) // UPC, Nominum?1299 return;1300 1301 1298 if(dh.qr) { 1302 1299 PacketID pident; … … 1304 1301 pident.id=dh.id; 1305 1302 pident.fd=fd; 1306 pident.domain=questionExpand(data, len, pident.type); // don't copy this from above - we need to do the actual read 1303 if(!dh.qdcount) { // UPC, Nominum, very old BIND on FormErr, NSD 1304 pident.domain.clear(); 1305 pident.type = 0; 1306 } 1307 else { 1308 pident.domain=questionExpand(data, len, pident.type); // don't copy this from above - we need to do the actual read 1309 } 1307 1310 string packet; 1308 1311 packet.assign(data, len); … … 1313 1316 } 1314 1317 1315 // s_timer.stop(); 1318 retryWithName: 1319 1316 1320 if(!MT->sendEvent(pident, &packet)) { 1317 // s_timer.start();1318 1321 // if(g_logCommonErrors) 1319 // L<<Logger::Warning<<"Discarding unexpected packet from "<<fromaddr.toString()<<": "<<pident.type<<endl;1322 // L<<Logger::Warning<<"Discarding unexpected packet from "<<fromaddr.toString()<<": "<<pident.type<<endl; 1320 1323 g_stats.unexpectedCount++; 1321 1324 … … 1325 1328 mthread->key.nearMisses++; 1326 1329 } 1330 1331 // be a bit paranoid here since we're weakening our matching 1332 if(pident.domain.empty() && !mthread->key.domain.empty() && !pident.type && mthread->key.type && 1333 pident.id == mthread->key.id && mthread->key.remote == pident.remote) { 1334 cerr<<"Empty response, rest matches though, sending to a waiter"<<endl; 1335 pident.domain = mthread->key.domain; 1336 pident.type = mthread->key.type; 1337 g_stats.unexpectedCount--; 1338 goto retryWithName; 1339 } 1327 1340 } 1328 1341 } 1329 1342 else if(fd >= 0) { 1330 // s_timer.start();1331 1343 g_udpclientsocks.returnSocket(fd); 1332 1344 }