BIND 10 trac2905, updated. c1d838b4ef7ed6a20b43987713981ff521aec274 [2905] corrected a member variable of example code in doxygen doc.

BIND 10 source code commits bind10-changes at lists.isc.org
Wed May 22 20:26:18 UTC 2013


The branch, trac2905 has been updated
       via  c1d838b4ef7ed6a20b43987713981ff521aec274 (commit)
       via  41aef4f8135de17e94f3d703ff8f461bfeedd94e (commit)
       via  e7e1564b312b70ed4d0c04e59025e337f0210729 (commit)
       via  9b41a2252bf1db1fe686ed4cb8b20d3fbbf1d5e6 (commit)
       via  c13f4a4ab9ddf938d9b5fd62e08574dd8dc210b1 (commit)
       via  c82208ea06ca7d72186cc606cc4038bb35b7afc1 (commit)
       via  f34eec70bf82d42c27a0df4709b0682abf2f7b2a (commit)
      from  ccf4516112346e4722125b2004138b7a78d701e0 (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 c1d838b4ef7ed6a20b43987713981ff521aec274
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed May 22 13:25:48 2013 -0700

    [2905] corrected a member variable of example code in doxygen doc.

commit 41aef4f8135de17e94f3d703ff8f461bfeedd94e
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed May 22 13:08:21 2013 -0700

    [2905] clarify the case we pass NULL to ZoneWriter::load() in comments.

commit e7e1564b312b70ed4d0c04e59025e337f0210729
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed May 22 13:03:56 2013 -0700

    [2905] revised a doxygen code example so it'll be more consistent overall.

commit 9b41a2252bf1db1fe686ed4cb8b20d3fbbf1d5e6
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed May 22 13:01:38 2013 -0700

    [2905] updated test comments for more clarity

commit c13f4a4ab9ddf938d9b5fd62e08574dd8dc210b1
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed May 22 12:59:29 2013 -0700

    [2905] revised an exception what() message to be hopefully more unstandable.

commit c82208ea06ca7d72186cc606cc4038bb35b7afc1
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed May 22 11:29:12 2013 -0700

    [2905] refer relevant documentation for ZoneTable::FindResult
    
    it's described in the context of findZone() method.

commit f34eec70bf82d42c27a0df4709b0682abf2f7b2a
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Wed May 22 11:24:57 2013 -0700

    [2905] preserved existing ZoneNode flag values for ZoneData.
    
    added a note on the numbering.
    and made one piggyback cleanup: define public static const explicitly.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/datasrc/client_list.h                      |    6 +++---
 src/lib/datasrc/memory/zone_data.cc                |    4 ++++
 src/lib/datasrc/memory/zone_data.h                 |   17 +++++++++++------
 src/lib/datasrc/memory/zone_table.cc               |    4 +++-
 src/lib/datasrc/memory/zone_table.h                |    2 ++
 .../datasrc/tests/memory/zone_table_unittest.cc    |    4 ++--
 .../datasrc/tests/memory/zone_writer_unittest.cc   |    4 +++-
 7 files changed, 28 insertions(+), 13 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/client_list.h b/src/lib/datasrc/client_list.h
index c0d4793..eb1c1ec 100644
--- a/src/lib/datasrc/client_list.h
+++ b/src/lib/datasrc/client_list.h
@@ -231,11 +231,11 @@ public:
     /// of the searched name is needed. Therefore, the call would look like:
     ///
     /// \code FindResult result(list->find(queried_name));
-    ///   if (result.datasrc_) {
+    ///   if (result.dsrc_client_) {
     ///       if (result.finder_) {
     ///           createTheAnswer(result.finder_);
-    ///       } else {
-    ///           // broken zone, handle it accordingly.
+    ///       } else { // broken zone, return SERVFAIL
+    ///           createErrorMessage(Rcode.SERVFAIL());
     ///       }
     ///   } else {
     ///       createNotAuthAnswer();
diff --git a/src/lib/datasrc/memory/zone_data.cc b/src/lib/datasrc/memory/zone_data.cc
index a1d3430..cdcb683 100644
--- a/src/lib/datasrc/memory/zone_data.cc
+++ b/src/lib/datasrc/memory/zone_data.cc
@@ -38,6 +38,10 @@ namespace isc {
 namespace datasrc {
 namespace memory {
 
+// Definition of a class static constant.  It's public and its address
+// could be needed by applications, so we need an explicit definition.
+const ZoneNode::Flags ZoneData::DNSSEC_SIGNED;
+
 namespace {
 void
 rdataSetDeleter(RRClass rrclass, util::MemorySegment* mem_sgmt,
diff --git a/src/lib/datasrc/memory/zone_data.h b/src/lib/datasrc/memory/zone_data.h
index 4d71771..b4c65f7 100644
--- a/src/lib/datasrc/memory/zone_data.h
+++ b/src/lib/datasrc/memory/zone_data.h
@@ -378,22 +378,27 @@ private:
     /// It never throws an exception.
     ZoneData(ZoneTree* zone_tree, ZoneNode* origin_node);
 
-    // Zone node flags.
+    // Zone node flags.  When adding a new flag, it's generally advisable to
+    // keep existing values so the binary image of the data is as much
+    // backward compatible as possible.  And it can be helpful in practice
+    // for file-mapped data.
 private:
     // Set in the origin node (which always exists at the same address)
     // to indicate whether the zone is signed or not.  Internal use,
     // so defined as private.
     static const ZoneNode::Flags DNSSEC_SIGNED = ZoneNode::FLAG_USER1;
 
-    // Also set in the origin node, indicating this is a special "empty zone",
-    // that could be created only by the corresponding create() method to be
-    // used for some kind of sentinel data.
-    static const ZoneNode::Flags EMPTY_ZONE = ZoneNode::FLAG_USER2;
 public:
     /// \brief Node flag indicating it is at a "wildcard level"
     ///
     /// This means one of the node's immediate children is a wildcard.
-    static const ZoneNode::Flags WILDCARD_NODE = ZoneNode::FLAG_USER3;
+    static const ZoneNode::Flags WILDCARD_NODE = ZoneNode::FLAG_USER2;
+
+private:
+    // Also set in the origin node, indicating this is a special "empty zone",
+    // that could be created only by the corresponding create() method to be
+    // used for some kind of sentinel data.
+    static const ZoneNode::Flags EMPTY_ZONE = ZoneNode::FLAG_USER3;
 
 public:
     /// \brief Allocate and construct \c ZoneData.
diff --git a/src/lib/datasrc/memory/zone_table.cc b/src/lib/datasrc/memory/zone_table.cc
index 776a760..e1b9baf 100644
--- a/src/lib/datasrc/memory/zone_table.cc
+++ b/src/lib/datasrc/memory/zone_table.cc
@@ -89,7 +89,9 @@ ZoneTable::addZone(util::MemorySegment& mem_sgmt, RRClass zone_class,
         arg(zone_name).arg(rrclass_);
 
     if (!content || content->isEmpty()) {
-        isc_throw(InvalidParameter, "Zone content must not be NULL or empty");
+        isc_throw(InvalidParameter,
+                  (content ? "empty data" : "NULL") <<
+                  " is passed to Zone::addZone");
     }
     SegmentObjectHolder<ZoneData, RRClass> holder(mem_sgmt, zone_class);
     holder.set(content);
diff --git a/src/lib/datasrc/memory/zone_table.h b/src/lib/datasrc/memory/zone_table.h
index d792e2a..d092467 100644
--- a/src/lib/datasrc/memory/zone_table.h
+++ b/src/lib/datasrc/memory/zone_table.h
@@ -84,6 +84,8 @@ public:
      };
 
     /// \brief Result data of findZone() method.
+    ///
+    /// See \c findZone() about the semantics of the members.
     struct FindResult {
         FindResult(result::Result param_code,
                    const ZoneData* param_zone_data,
diff --git a/src/lib/datasrc/tests/memory/zone_table_unittest.cc b/src/lib/datasrc/tests/memory/zone_table_unittest.cc
index f2e74ef..328274f 100644
--- a/src/lib/datasrc/tests/memory/zone_table_unittest.cc
+++ b/src/lib/datasrc/tests/memory/zone_table_unittest.cc
@@ -73,12 +73,12 @@ TEST_F(ZoneTableTest, addZone) {
     // By default there's no zone contained.
     EXPECT_EQ(0, zone_table->getZoneCount());
 
-    // It doesn't accept empty (NULL) zones
+    // It doesn't accept NULL as zone data
     EXPECT_THROW(zone_table->addZone(mem_sgmt_, zclass_, zname1, NULL),
                  isc::InvalidParameter);
     EXPECT_EQ(0, zone_table->getZoneCount()); // count is still 0
 
-    // or an empty zone
+    // or an empty zone data
     SegmentObjectHolder<ZoneData, RRClass> holder_empty(
         mem_sgmt_, zclass_);
     holder_empty.set(ZoneData::create(mem_sgmt_));
diff --git a/src/lib/datasrc/tests/memory/zone_writer_unittest.cc b/src/lib/datasrc/tests/memory/zone_writer_unittest.cc
index dd9321e..1838fa9 100644
--- a/src/lib/datasrc/tests/memory/zone_writer_unittest.cc
+++ b/src/lib/datasrc/tests/memory/zone_writer_unittest.cc
@@ -267,7 +267,9 @@ TEST_F(ZoneWriterTest, loadLoaderException) {
     EXPECT_EQ("", error_msg);
 
     // If we specify allowing load error, load() will succeed and install()
-    // adds an empty zone.
+    // adds an empty zone.  Note that we implicitly pass NULL to load()
+    // as it's the default parameter, so the following also confirms it doesn't
+    // cause disruption.
     writer_.reset(new ZoneWriter(*segment_,
                                  bind(&ZoneWriterTest::loadAction, this, _1),
                                  Name("example.org"), RRClass::IN(), true));



More information about the bind10-changes mailing list