Show
Ignore:
Timestamp:
03/14/11 15:26:38 (2 years ago)
Author:
ahu
Message:

backport the asynchronous SOA liveness checking from 3.0

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tags/pdns-2-9-22-x/pdns/slavecommunicator.cc

    r1725 r2063  
    161161}; 
    162162 
     163 
     164void CommunicatorClass::addSlaveCheckRequest(const DomainInfo& di, const ComboAddress& remote) 
     165{ 
     166  Lock l(&d_lock); 
     167  d_tocheck.insert(di); 
     168  d_any_sem.post(); // kick the loop! 
     169} 
     170 
    163171void CommunicatorClass::slaveRefresh(PacketHandler *P) 
    164172{ 
    165173  UeberBackend *B=dynamic_cast<UeberBackend *>(P->getBackend()); 
    166174  vector<DomainInfo> sdomains, rdomains; 
    167   B->getUnfreshSlaveInfos(&rdomains); 
     175   
     176  { 
     177    Lock l(&d_lock); 
     178    rdomains.insert(rdomains.end(), d_tocheck.begin(), d_tocheck.end()); 
     179    d_tocheck.clear(); 
     180  } 
     181   
     182  if(rdomains.empty()) // if we have priority domains, check them first 
     183    B->getUnfreshSlaveInfos(&rdomains); 
     184     
    168185   
    169186  {