From: Ruben d'Arco Date: Tue, 4 Dec 2012 07:02:09 +0000 (+0100) Subject: Clearer counting of changes. X-Git-Tag: rec-3.6.0-rc1~556^2~3^2~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0704e0dacc693474295ff6eba2a846006cd9190;p=thirdparty%2Fpdns.git Clearer counting of changes. --- diff --git a/pdns/rfc2136handler.cc b/pdns/rfc2136handler.cc index 715843fba1..fc8074900b 100644 --- a/pdns/rfc2136handler.cc +++ b/pdns/rfc2136handler.cc @@ -80,7 +80,7 @@ int PacketHandler::checkUpdatePrescan(const DNSRecord *rr) { // Implements section 3.4.2 of RFC2136 uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, DomainInfo *di, bool narrow, bool haveNSEC3, const NSEC3PARAMRecordContent *ns3pr, bool *updatedSerial) { - uint16_t addedRecords = 0, updatedRecords = 0; + uint16_t changedRecords = 0; DNSResourceRecord rec; vector rrset, recordsToDelete; set delnonterm, insnonterm; // used to (at the end) fix ENT records. @@ -109,7 +109,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * oldRec->setContent(rr->d_content->getZoneRepresentation()); fillSOAData(oldRec->content, sdUpdate); if (rfc1982LessThan(sdOld.serial, sdUpdate.serial)) { - updatedRecords++; + changedRecords++; di->backend->replaceRRSet(di->id, oldRec->qname, oldRec->qtype, rrset); *updatedSerial = true; } @@ -121,7 +121,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * for (vector::iterator i = rrset.begin(); i != rrset.end(); i++) { i->ttl = rr->d_ttl; i->setContent(rr->d_content->getZoneRepresentation()); - updatedRecords++; + changedRecords++; } di->backend->replaceRRSet(di->id, rrLabel, rrType, rrset); @@ -133,7 +133,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * if (rrType == i->qtype.getCode() && i->getZoneRepresentation() == content) { foundRecord = true; i->ttl = rr->d_ttl; - updatedRecords++; + changedRecords++; } } if (foundRecord) @@ -148,7 +148,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * DNSResourceRecord newRec(*rr); newRec.domain_id = di->id; di->backend->feedRecord(newRec); - addedRecords++; + changedRecords++; // because we added a record, we need to fix DNSSEC data. @@ -335,7 +335,7 @@ uint16_t PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord * } } - return recordsToDelete.size() + addedRecords + updatedRecords; + return recordsToDelete.size() + changedRecords; } int PacketHandler::processUpdate(DNSPacket *p) {