From: Otto Date: Fri, 5 Feb 2021 13:16:31 +0000 (+0100) Subject: Do not use local vars that start with d_, our naming convention is that X-Git-Tag: dnsdist-1.6.0-alpha2~55^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f80ebc051798dc32bf004c59f298fc2ada7257e2;p=thirdparty%2Fpdns.git Do not use local vars that start with d_, our naming convention is that those are fields of a class. --- diff --git a/pdns/dnspacket.cc b/pdns/dnspacket.cc index 15d5913307..fcc4366ad8 100644 --- a/pdns/dnspacket.cc +++ b/pdns/dnspacket.cc @@ -132,8 +132,8 @@ void DNSPacket::addRecord(DNSZoneRecord&& rr) std::string ser = const_cast(rr).dr.d_content->serialize(rr.dr.d_name); auto hash = boost::hash< std::pair >()({rr.dr.d_name, ser}); if(d_dedup.count(hash)) { // might be a dup - for(auto & d_rr : d_rrs) { - if(rr.dr == d_rr.dr) // XXX SUPER SLOW + for(auto & i : d_rrs) { + if(rr.dr == i.dr) // XXX SUPER SLOW return; } } @@ -147,14 +147,14 @@ vector DNSPacket::getAPRecords() { vector arrs; - for(auto & d_rr : d_rrs) + for(auto & i : d_rrs) { - if(d_rr.dr.d_place!=DNSResourceRecord::ADDITIONAL && - (d_rr.dr.d_type==QType::MX || - d_rr.dr.d_type==QType::NS || - d_rr.dr.d_type==QType::SRV)) + if(i.dr.d_place!=DNSResourceRecord::ADDITIONAL && + (i.dr.d_type==QType::MX || + i.dr.d_type==QType::NS || + i.dr.d_type==QType::SRV)) { - arrs.push_back(&d_rr); + arrs.push_back(&i); } } return arrs; diff --git a/pdns/dnsproxy.cc b/pdns/dnsproxy.cc index 54eff32097..4487cce5b3 100644 --- a/pdns/dnsproxy.cc +++ b/pdns/dnsproxy.cc @@ -253,17 +253,17 @@ void DNSProxy::mainloop() MOADNSParser mdp(false, p.getString()); // cerr<<"Got completion, "<first.d_place-1<<" "<first.d_label<<" " << DNSRecordContent::NumberToType(j->first.d_type)<<" "<first.d_content->getZoneRepresentation()<second.qtype || (i->second.qtype == QType::ANY && (d_answer.first.d_type == QType::A || d_answer.first.d_type == QType::AAAA))) { + if(answer.first.d_type == i->second.qtype || (i->second.qtype == QType::ANY && (answer.first.d_type == QType::A || answer.first.d_type == QType::AAAA))) { DNSZoneRecord dzr; dzr.dr.d_name=i->second.aname; - dzr.dr.d_type = d_answer.first.d_type; - dzr.dr.d_ttl=d_answer.first.d_ttl; - dzr.dr.d_place= d_answer.first.d_place; - dzr.dr.d_content=d_answer.first.d_content; + dzr.dr.d_type = answer.first.d_type; + dzr.dr.d_ttl=answer.first.d_ttl; + dzr.dr.d_place= answer.first.d_place; + dzr.dr.d_content=answer.first.d_content; i->second.complete->addRecord(std::move(dzr)); } } diff --git a/pdns/rfc2136handler.cc b/pdns/rfc2136handler.cc index 35d52e5903..12f007655f 100644 --- a/pdns/rfc2136handler.cc +++ b/pdns/rfc2136handler.cc @@ -729,8 +729,8 @@ int PacketHandler::processUpdate(DNSPacket& p) { return forwardPacket(msgPrefix, p, di); // Check if all the records provided are within the zone - for(const auto & d_answer : mdp.d_answers) { - const DNSRecord *rr = &d_answer.first; + for(const auto & answer : mdp.d_answers) { + const DNSRecord *rr = &answer.first; // Skip this check for other field types (like the TSIG - which is in the additional section) // For a TSIG, the label is the dnskey, so it does not pass the endOn validation. if (! (rr->d_place == DNSResourceRecord::ANSWER || rr->d_place == DNSResourceRecord::AUTHORITY)) @@ -751,8 +751,8 @@ int PacketHandler::processUpdate(DNSPacket& p) { } // 3.2.1 and 3.2.2 - Prerequisite check - for(const auto & d_answer : mdp.d_answers) { - const DNSRecord *rr = &d_answer.first; + for(const auto & answer : mdp.d_answers) { + const DNSRecord *rr = &answer.first; if (rr->d_place == DNSResourceRecord::ANSWER) { int res = checkUpdatePrerequisites(rr, &di); if (res>0) { @@ -816,8 +816,8 @@ int PacketHandler::processUpdate(DNSPacket& p) { try { uint changedRecords = 0; // 3.4.1 - Prescan section - for(const auto & d_answer : mdp.d_answers) { - const DNSRecord *rr = &d_answer.first; + for(const auto & answer : mdp.d_answers) { + const DNSRecord *rr = &answer.first; if (rr->d_place == DNSResourceRecord::AUTHORITY) { int res = checkUpdatePrescan(rr); if (res>0) { @@ -862,8 +862,8 @@ int PacketHandler::processUpdate(DNSPacket& p) { } vector cnamesToAdd, nonCnamesToAdd; - for(const auto & d_answer : mdp.d_answers) { - const DNSRecord *rr = &d_answer.first; + for(const auto & answer : mdp.d_answers) { + const DNSRecord *rr = &answer.first; if (rr->d_place == DNSResourceRecord::AUTHORITY) { /* see if it's permitted by policy */ if (this->d_update_policy_lua != nullptr) { diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc index 1cd35936fe..1531c48a3a 100644 --- a/pdns/tcpreceiver.cc +++ b/pdns/tcpreceiver.cc @@ -1000,8 +1000,8 @@ int TCPNameserver::doIXFR(std::unique_ptr& q, int outsock) uint32_t serial = 0; MOADNSParser mdp(false, q->getString()); - for(const auto & d_answer : mdp.d_answers) { - const DNSRecord *rr = &d_answer.first; + for(const auto & answer : mdp.d_answers) { + const DNSRecord *rr = &answer.first; if (rr->d_type == QType::SOA && rr->d_place == DNSResourceRecord::AUTHORITY) { vectorparts; stringtok(parts, rr->d_content->getZoneRepresentation());