From: Fred Morcos Date: Thu, 22 Sep 2022 15:16:12 +0000 (+0200) Subject: Formatting X-Git-Tag: rec-4.9.0-alpha0~35^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de42d2df6d106cf163adfb3f5f333f7182f4ec36;p=thirdparty%2Fpdns.git Formatting --- diff --git a/pdns/communicator.hh b/pdns/communicator.hh index 78746ffe00..c96795ee5a 100644 --- a/pdns/communicator.hh +++ b/pdns/communicator.hh @@ -82,14 +82,14 @@ public: d_nqueue.push_back(nr); } - bool removeIf(const string &remote, uint16_t id, const DNSName &domain) + bool removeIf(const string& remote, uint16_t id, const DNSName& domain) { ServiceTuple stRemote, stQueued; parseService(remote, stRemote); - for(d_nqueue_t::iterator i=d_nqueue.begin(); i!=d_nqueue.end(); ++i) { + for (d_nqueue_t::iterator i = d_nqueue.begin(); i != d_nqueue.end(); ++i) { parseService(i->ip, stQueued); - if(i->id==id && stQueued.host == stRemote.host && i->domain==domain) { + if (i->id == id && stQueued.host == stRemote.host && i->domain == domain) { d_nqueue.erase(i); return true; } @@ -99,7 +99,7 @@ public: bool getOne(DNSName &domain, string &ip, uint16_t *id, bool &purged) { - for(d_nqueue_t::iterator i=d_nqueue.begin();i!=d_nqueue.end();++i) + for(d_nqueue_t::iterator i=d_nqueue.begin();i!=d_nqueue.end();++i) if(i->next <= time(0)) { i->attempts++; purged=false; @@ -119,8 +119,8 @@ public: time_t earliest() { - time_t early=std::numeric_limits::max() - 1; - for(d_nqueue_t::const_iterator i=d_nqueue.begin();i!=d_nqueue.end();++i) + time_t early=std::numeric_limits::max() - 1; + for(d_nqueue_t::const_iterator i=d_nqueue.begin();i!=d_nqueue.end();++i) early=min(early,i->next); return early-time(0); } @@ -150,7 +150,7 @@ struct ZoneStatus; class CommunicatorClass { public: - CommunicatorClass() + CommunicatorClass() { d_tickinterval=60; d_slaveschanged = true; @@ -160,8 +160,8 @@ public: } time_t doNotifications(PacketHandler *P); void go(); - - + + void drillHole(const DNSName &domain, const string &ip); bool justNotified(const DNSName &domain, const string &ip); void addSuckRequest(const DNSName &domain, const ComboAddress& master, SuckRequest::RequestPriority, bool force=false); @@ -227,7 +227,7 @@ private: { explicit RemoveSentinel(const DNSName& dn, CommunicatorClass* cc) : d_dn(dn), d_cc(cc) {} - + ~RemoveSentinel() { try { @@ -251,7 +251,7 @@ public: vector addresses; this->resolve_name(&addresses, name); - + if(b) { b->lookup(QType(QType::ANY),name,-1); DNSZoneRecord rr; diff --git a/pdns/mastercommunicator.cc b/pdns/mastercommunicator.cc index 102a484757..ac7dfd8c39 100644 --- a/pdns/mastercommunicator.cc +++ b/pdns/mastercommunicator.cc @@ -126,7 +126,7 @@ bool CommunicatorClass::notifyDomain(const DNSName &domain, UeberBackend* B) if (di.serial != di.notified_serial) di.backend->setNotified(di.id, di.serial); - return true; + return true; } void NotificationQueue::dump() @@ -212,9 +212,9 @@ void CommunicatorClass::masterUpdateCheck(PacketHandler *P) } } -time_t CommunicatorClass::doNotifications(PacketHandler *P) +time_t CommunicatorClass::doNotifications(PacketHandler* P) { - UeberBackend *B=P->getBackend(); + UeberBackend* B = P->getBackend(); ComboAddress from; Utility::socklen_t fromlen; char buffer[1500]; @@ -223,59 +223,58 @@ time_t CommunicatorClass::doNotifications(PacketHandler *P) set fds = {d_nsock4, d_nsock6}; // receive incoming notifications on the nonblocking socket and take them off the list - while(waitForMultiData(fds, 0, 0, &sock) > 0) { - fromlen=sizeof(from); - size=recvfrom(sock,buffer,sizeof(buffer),0,(struct sockaddr *)&from,&fromlen); - if(size < 0) + while (waitForMultiData(fds, 0, 0, &sock) > 0) { + fromlen = sizeof(from); + size = recvfrom(sock, buffer, sizeof(buffer), 0, (struct sockaddr*)&from, &fromlen); + if (size < 0) break; DNSPacket p(true); p.setRemote(&from); - if(p.parse(buffer,(size_t)size)<0) { - g_log< packet; DNSPacketWriter pw(packet, domain, QType::SOA, 1, Opcode::Notify); pw.getHeader()->id = id; - pw.getHeader()->aa = true; + pw.getHeader()->aa = true; if (tsigkeyname.empty() == false) { if (!B->getTSIGKey(tsigkeyname, tsigalgorithm, tsigsecret64)) { @@ -343,7 +342,7 @@ bool CommunicatorClass::justNotified(const DNSName &domain, const string &ip) return true; } - // do we want to purge this? XXX FIXME + // do we want to purge this? XXX FIXME return false; }