]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
reduce back and forth type conversions; beter var naming 10562/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 1 Oct 2021 15:52:39 +0000 (17:52 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 1 Oct 2021 15:52:39 +0000 (17:52 +0200)
pdns/mastercommunicator.cc

index 7bd71f476f1096cbdb7b48982bb753bbe0257e92..21b0488bab452ee543d76863c57e47e91689e487 100644 (file)
 void CommunicatorClass::queueNotifyDomain(const DomainInfo& di, UeberBackend* B)
 {
   bool hasQueuedItem=false;
-  set<string> nsset, ips;
+  set<string> ips;
+  set<DNSName> nsset;
   DNSZoneRecord rr;
   FindNS fns;
 
-
   try {
   if (d_onlyNotify.size()) {
     B->lookup(QType(QType::NS), di.zone, di.id);
     while(B->get(rr))
-      nsset.insert(getRR<NSRecordContent>(rr.dr)->getNS().toString());
+      nsset.insert(getRR<NSRecordContent>(rr.dr)->getNS());
 
-    for(const auto & j : nsset) {
-      auto dnsj = DNSName(j);
-      vector<string> nsips=fns.lookup(dnsj, B);
+    for(const auto & ns : nsset) {
+      vector<string> nsips=fns.lookup(ns, B);
       if(nsips.empty())
-        g_log<<Logger::Warning<<"Unable to queue notification of domain '"<<di.zone<<"' to nameserver '"<<dnsj<<"': nameserver does not resolve!"<<endl;
+        g_log<<Logger::Warning<<"Unable to queue notification of domain '"<<di.zone<<"' to nameserver '"<<ns<<"': nameserver does not resolve!"<<endl;
       else
         for(const auto & nsip : nsips) {
           const ComboAddress caIp(nsip, 53);
           if(!d_preventSelfNotification || !AddressIsUs(caIp)) {
             if(!d_onlyNotify.match(&caIp))
-              g_log<<Logger::Notice<<"Skipped notification of domain '"<<di.zone<<"' to "<<dnsj<<" because "<<caIp<<" does not match only-notify."<<endl;
+              g_log<<Logger::Notice<<"Skipped notification of domain '"<<di.zone<<"' to "<<ns<<" because "<<caIp<<" does not match only-notify."<<endl;
             else
               ips.insert(caIp.toStringWithPort());
           }