From 0de8295bf7187f86aba7cae9b390096ee7d83711 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 18 Jun 2019 15:00:40 +0200 Subject: [PATCH] doCNAMECacheCheck: Rename iterator variable Renames `j` to `record` for clarity and dereferences it. --- pdns/syncres.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 22df12e491..e1a5f56720 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -1103,12 +1103,12 @@ bool SyncRes::doCNAMECacheCheck(const DNSName &qname, const QType &qtype, vector return false; } - for(auto j=cset.cbegin() ; j != cset.cend() ; ++j) { - if (j->d_class != QClass::IN) { + for(auto const &record : cset) { + if (record.d_class != QClass::IN) { continue; } - if(j->d_ttl>(unsigned int) d_now.tv_sec) { + if(record.d_ttl > (unsigned int) d_now.tv_sec) { if (!wasAuthZone && shouldValidate() && (wasAuth || wasForwardRecurse) && state == Indeterminate && d_requireAuthData) { /* This means we couldn't figure out the state when this entry was cached, @@ -1135,9 +1135,9 @@ bool SyncRes::doCNAMECacheCheck(const DNSName &qname, const QType &qtype, vector } } - LOG(prefix<d_content->getZoneRepresentation()<<"', validation state is "<getZoneRepresentation()<<"', validation state is "<(*j); + auto dnameRR = getRR(record); if (dnameRR == nullptr) { throw ImmediateServFailException("Unable to get record content for "+foundName.toLogString()+"|DNAME cache entry"); } @@ -1200,7 +1200,7 @@ bool SyncRes::doCNAMECacheCheck(const DNSName &qname, const QType &qtype, vector // We have a DNAME _or_ CNAME cache hit and the client wants something else than those two. // Let's find the answer! if (foundQT == QType::CNAME) { - const auto cnameContent = getRR(*j); + const auto cnameContent = getRR(record); if (cnameContent == nullptr) { throw ImmediateServFailException("Unable to get record content for "+foundName.toLogString()+"|CNAME cache entry"); } -- 2.39.2