Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions modules/geoipbackend/geoipbackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
17 changes: 11 additions & 6 deletions modules/lmdbbackend/lmdbbackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2270,15 +2270,20 @@ void LMDBBackend::getAllDomainsFiltered(vector<DomainInfo>* domains, const std::
}
}

void LMDBBackend::getAllDomains(vector<DomainInfo>* domains, bool /* doSerial */, bool include_disabled)
{
getAllDomainsFiltered(domains, [this, include_disabled](DomainInfo& di) {
if (!getSerial(di) && !include_disabled) {
return false;
void LMDBBackend::getAllDomains(vector<DomainInfo>* domains, bool doSerial, bool include_disabled)
{
getAllDomainsFiltered(domains, [this, doSerial, include_disabled](DomainInfo& info) {
// We need to read the SOA record in order to know if the domain is
// disabled. If we don't care about serials and want all domains to be
// returned, skip the SOA record retrieval.
if (doSerial || !include_disabled) {
if (!getSerial(info) && !include_disabled) {
return false;
}
}

// Skip domains with variants if views are disabled.
if (di.zone.hasVariant() && !d_views) {
if (info.zone.hasVariant() && !d_views) {
return false;
}

Expand Down