From: Miod Vallat Date: Fri, 28 Nov 2025 10:27:22 +0000 (+0100) Subject: Skip SOA fetch in GeoIPBackend::getAllDomains if serials aren't needed. X-Git-Tag: rec-5.5.0-alpha0~21^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfaf1dc4d2618ed1dd60c38bca7d6398bc444ffb;p=thirdparty%2Fpdns.git Skip SOA fetch in GeoIPBackend::getAllDomains if serials aren't needed. Signed-off-by: Miod Vallat --- diff --git a/modules/geoipbackend/geoipbackend.cc b/modules/geoipbackend/geoipbackend.cc index 0c4f90027f..331c403b8d 100644 --- a/modules/geoipbackend/geoipbackend.cc +++ b/modules/geoipbackend/geoipbackend.cc @@ -961,19 +961,21 @@ bool GeoIPBackend::getDomainInfo(const ZoneName& domain, DomainInfo& info, bool return false; } -void GeoIPBackend::getAllDomains(vector* domains, bool /* getSerial */, bool /* include_disabled */) +void GeoIPBackend::getAllDomains(vector* 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); } }