From: Christian Hofstaedtler Date: Sun, 15 Feb 2015 14:01:28 +0000 (+0100) Subject: Replace PacketHandler with UeberBackend where possible X-Git-Tag: dnsdist-1.0.0-alpha1~288^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2237%2Fhead;p=thirdparty%2Fpdns.git Replace PacketHandler with UeberBackend where possible Makes reasoning about PacketHandler usage easier. --- diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index cb10990ac8..51d52328dd 100644 --- a/pdns/dynhandler.cc +++ b/pdns/dynhandler.cc @@ -231,8 +231,8 @@ string DLNotifyRetrieveHandler(const vector&parts, Utility::pid_t ppid) const string& domain=parts[1]; DomainInfo di; - PacketHandler P; - if(!P.getBackend()->getDomainInfo(domain, di)) + UeberBackend B; + if(!B.getDomainInfo(domain, di)) return "Domain '"+domain+"' unknown"; if(di.masters.empty()) @@ -300,11 +300,11 @@ string DLNotifyHandler(const vector&parts, Utility::pid_t ppid) string DLRediscoverHandler(const vector&parts, Utility::pid_t ppid) { - PacketHandler P; + UeberBackend B; try { L<rediscover(&status); + B.rediscover(&status); return status; } catch(PDNSException &ae) { @@ -315,8 +315,8 @@ string DLRediscoverHandler(const vector&parts, Utility::pid_t ppid) string DLReloadHandler(const vector&parts, Utility::pid_t ppid) { - PacketHandler P; - P.getBackend()->reload(); + UeberBackend B; + B.reload(); L<getDomainInfo(domain, di)) { + UeberBackend B; + if(!B.getDomainInfo(domain, di)) { L<setNotified(di.id, di.serial); diff --git a/pdns/slavecommunicator.cc b/pdns/slavecommunicator.cc index d44f8abcae..e28513da54 100644 --- a/pdns/slavecommunicator.cc +++ b/pdns/slavecommunicator.cc @@ -65,16 +65,15 @@ void CommunicatorClass::addSuckRequest(const string &domain, const string &maste void CommunicatorClass::suck(const string &domain,const string &remote) { L<getDomainInfo(domain, di) || !di.backend) { // di.backend and B are mostly identical + if(!B.getDomainInfo(domain, di) || !di.backend) { // di.backend and B are mostly identical L<getTSIGKey(tsigkeyname, &tsigalgorithm, &tsigsecret64)) { + if(B.getTSIGKey(tsigkeyname, &tsigalgorithm, &tsigsecret64)) { B64Decode(tsigsecret64, tsigsecret); } else { L< pdl; vector scripts; - if(B->getDomainMetadata(domain, "LUA-AXFR-SCRIPT", scripts) && !scripts.empty()) { + if(B.getDomainMetadata(domain, "LUA-AXFR-SCRIPT", scripts) && !scripts.empty()) { try { pdl.reset(new AuthLua(scripts[0])); L< localaddr; ComboAddress laddr; - if(B->getDomainMetadata(domain, "AXFR-SOURCE", localaddr) && !localaddr.empty()) { + if(B.getDomainMetadata(domain, "AXFR-SOURCE", localaddr) && !localaddr.empty()) { try { laddr = ComboAddress(localaddr[0]); L<