Changeset 67 for trunk/pdns/pdns/resolver.cc
- Timestamp:
- 12/12/02 20:53:20 (11 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/resolver.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/resolver.cc
r2 r67 74 74 d_sock=-1; 75 75 d_timeout=500000; 76 d_soacount=0; 76 77 d_buf=new unsigned char[66000]; 77 78 } … … 329 330 int Resolver::axfrChunk(Resolver::res_t &res) 330 331 { 332 if(d_soacount>1) { 333 Utility::closesocket(d_sock); 334 d_sock=-1; 335 return 0; 336 } 337 331 338 // d_sock is connected and is about to spit out a packet 332 339 int len=getLength(); … … 336 343 timeoutReadn((char *)d_buf,len); 337 344 d_len=len; 345 338 346 res=result(); 339 if(!res.empty())340 if( res.begin()->qtype.getCode()==QType::SOA || res.end()->qtype.getCode()==QType::SOA)347 for(res_t::const_iterator i=res.begin();i!=res.end();++i) 348 if(i->qtype.getCode()==QType::SOA) { 341 349 d_soacount++; 342 343 if(d_soacount==2) { 344 Utility::closesocket(d_sock); 345 d_sock=-1; 346 return 0; 347 } 350 } 351 352 if(d_soacount>1 && !res.empty()) // chop off the last SOA 353 res.resize(res.size()-1); 354 348 355 349 356 return 1;