Show
Ignore:
Timestamp:
12/12/02 20:53:20 (11 years ago)
Author:
ahu
Message:

heading up to 2.9.2

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/resolver.cc

    r2 r67  
    7474  d_sock=-1; 
    7575  d_timeout=500000; 
     76  d_soacount=0; 
    7677  d_buf=new unsigned char[66000]; 
    7778} 
     
    329330int Resolver::axfrChunk(Resolver::res_t &res) 
    330331{ 
     332  if(d_soacount>1) { 
     333    Utility::closesocket(d_sock); 
     334    d_sock=-1; 
     335    return 0; 
     336  } 
     337 
    331338  // d_sock is connected and is about to spit out a packet 
    332339  int len=getLength(); 
     
    336343  timeoutReadn((char *)d_buf,len);  
    337344  d_len=len; 
     345 
    338346  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) { 
    341349      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     
    348355 
    349356  return 1;