]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Skip SOA fetch in GeoIPBackend::getAllDomains if serials aren't needed.
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 28 Nov 2025 10:27:22 +0000 (11:27 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 28 Nov 2025 12:57:49 +0000 (13:57 +0100)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
modules/geoipbackend/geoipbackend.cc

index 0c4f90027fe4a44bfdc722f56cac79a96974e548..331c403b8d37402a5997713b53a83ebc9e0ded80 100644 (file)
@@ -961,19 +961,21 @@ bool GeoIPBackend::getDomainInfo(const ZoneName& domain, DomainInfo& info, bool
   return false;
 }
 
-void GeoIPBackend::getAllDomains(vector<DomainInfo>* domains, bool /* getSerial */, bool /* include_disabled */)
+void GeoIPBackend::getAllDomains(vector<DomainInfo>* domains, bool getSerial, bool /* include_disabled */)
 {
   ReadLock rl(&s_state_lock);
 
   DomainInfo di;
   for (const auto& dom : s_domains) {
-    SOAData sd;
-    this->getSOA(dom.domain, dom.id, sd);
     di.id = dom.id;
     di.zone = dom.domain;
-    di.serial = sd.serial;
     di.kind = DomainInfo::Native;
     di.backend = this;
+    if (getSerial) {
+      SOAData soa;
+      this->getSOA(dom.domain, dom.id, soa);
+      di.serial = soa.serial;
+    }
     domains->emplace_back(di);
   }
 }