BIND 10 trac2836, updated. 31df868ff405b57c6767fad73a7ba82ac0544e4a [2836] Move the actual addition to separate method
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu May 2 07:10:06 UTC 2013
The branch, trac2836 has been updated
via 31df868ff405b57c6767fad73a7ba82ac0544e4a (commit)
via 51c2df1a2974002d93335c5d762353795ba8ac92 (commit)
from 1d139b0a312bae07267448c6e679b50ce24e5fc2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 31df868ff405b57c6767fad73a7ba82ac0544e4a
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu May 2 09:05:11 2013 +0200
[2836] Move the actual addition to separate method
Move the actual addition of the data to the memory image to separate
private method. All the allocations from the memory segment should
happen inside this method. Also, the method is mostly exception safe (it
can add some branches in the tree, but they don't bother us and we'll
reuse them).
This'll allow us to retry the addition on the SegmentGrown exception.
commit 51c2df1a2974002d93335c5d762353795ba8ac92
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Thu May 2 09:04:06 2013 +0200
[2836] Cleanup: use references
Considering the const in front of the parameters, this was the original
intention anyway.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/memory/zone_data_updater.cc | 37 +++++++++++++++++----------
src/lib/datasrc/memory/zone_data_updater.h | 13 +++++++---
2 files changed, 32 insertions(+), 18 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/memory/zone_data_updater.cc b/src/lib/datasrc/memory/zone_data_updater.cc
index 4d7e7e0..ba03a79 100644
--- a/src/lib/datasrc/memory/zone_data_updater.cc
+++ b/src/lib/datasrc/memory/zone_data_updater.cc
@@ -247,8 +247,8 @@ ZoneDataUpdater::setupNSEC3(const ConstRRsetPtr rrset) {
}
void
-ZoneDataUpdater::addNSEC3(const Name& name, const ConstRRsetPtr rrset,
- const ConstRRsetPtr rrsig)
+ZoneDataUpdater::addNSEC3(const Name& name, const ConstRRsetPtr& rrset,
+ const ConstRRsetPtr& rrsig)
{
if (rrset) {
setupNSEC3<generic::NSEC3>(rrset);
@@ -283,8 +283,8 @@ ZoneDataUpdater::addNSEC3(const Name& name, const ConstRRsetPtr rrset,
void
ZoneDataUpdater::addRdataSet(const Name& name, const RRType& rrtype,
- const ConstRRsetPtr rrset,
- const ConstRRsetPtr rrsig)
+ const ConstRRsetPtr& rrset,
+ const ConstRRsetPtr& rrsig)
{
if (rrtype == RRType::NSEC3()) {
addNSEC3(name, rrset, rrsig);
@@ -373,6 +373,24 @@ ZoneDataUpdater::addRdataSet(const Name& name, const RRType& rrtype,
}
void
+ZoneDataUpdater::addInternal(const isc::dns::Name& name,
+ const isc::dns::RRType& rrtype,
+ const isc::dns::ConstRRsetPtr& rrset,
+ const isc::dns::ConstRRsetPtr& rrsig)
+{
+ // Add wildcards possibly contained in the owner name to the domain
+ // tree. This can only happen for the normal (non-NSEC3) tree.
+ // Note: this can throw an exception, breaking strong exception
+ // guarantee. (see also the note for the call to contextCheck()
+ // above).
+ if (rrtype != RRType::NSEC3()) {
+ addWildcards(name);
+ }
+
+ addRdataSet(name, rrtype, rrset, rrsig);
+}
+
+void
ZoneDataUpdater::add(const ConstRRsetPtr& rrset,
const ConstRRsetPtr& sig_rrset)
{
@@ -397,16 +415,7 @@ ZoneDataUpdater::add(const ConstRRsetPtr& rrset,
arg(rrset ? rrtype.toText() : "RRSIG(" + rrtype.toText() + ")").
arg(zone_name_);
- // Add wildcards possibly contained in the owner name to the domain
- // tree. This can only happen for the normal (non-NSEC3) tree.
- // Note: this can throw an exception, breaking strong exception
- // guarantee. (see also the note for the call to contextCheck()
- // above).
- if (rrtype != RRType::NSEC3()) {
- addWildcards(name);
- }
-
- addRdataSet(name, rrtype, rrset, sig_rrset);
+ addInternal(name, rrtype, rrset, sig_rrset);
}
} // namespace memory
diff --git a/src/lib/datasrc/memory/zone_data_updater.h b/src/lib/datasrc/memory/zone_data_updater.h
index 9d669a0..95d0611 100644
--- a/src/lib/datasrc/memory/zone_data_updater.h
+++ b/src/lib/datasrc/memory/zone_data_updater.h
@@ -159,6 +159,11 @@ private:
// contained in 'name' (e.g., '*.foo.example' in 'bar.*.foo.example').
void addWildcards(const isc::dns::Name& name);
+ void addInternal(const isc::dns::Name& name,
+ const isc::dns::RRType& rrtype,
+ const isc::dns::ConstRRsetPtr& rrset,
+ const isc::dns::ConstRRsetPtr& rrsig);
+
// Does some checks in context of the data that are already in the
// zone. Currently checks for forbidden combinations of RRsets in
// the same domain (CNAME+anything, DNAME+NS). If such condition is
@@ -175,12 +180,12 @@ private:
template <typename T>
void setupNSEC3(const isc::dns::ConstRRsetPtr rrset);
void addNSEC3(const isc::dns::Name& name,
- const isc::dns::ConstRRsetPtr rrset,
- const isc::dns::ConstRRsetPtr rrsig);
+ const isc::dns::ConstRRsetPtr& rrset,
+ const isc::dns::ConstRRsetPtr& rrsig);
void addRdataSet(const isc::dns::Name& name,
const isc::dns::RRType& rrtype,
- const isc::dns::ConstRRsetPtr rrset,
- const isc::dns::ConstRRsetPtr rrsig);
+ const isc::dns::ConstRRsetPtr& rrset,
+ const isc::dns::ConstRRsetPtr& rrsig);
util::MemorySegment& mem_sgmt_;
const isc::dns::RRClass rrclass_;
More information about the bind10-changes
mailing list