BIND 10 trac1747, updated. 961f28cdfb0f5cc1f5be9613d5f60a7801c92b0a [1747] minor editorial fixes: brace position, fold long lines, redundant space

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Mar 13 05:38:55 UTC 2012


The branch, trac1747 has been updated
       via  961f28cdfb0f5cc1f5be9613d5f60a7801c92b0a (commit)
       via  cf5904a4ad2685c8923f4fbee1987132595908db (commit)
       via  3d402d65a8aa0f271190b40f5e141c4e5ee7b31d (commit)
      from  c0c59aceac2afeec9ae3e2711b21e177046b9db3 (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 961f28cdfb0f5cc1f5be9613d5f60a7801c92b0a
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Mar 12 22:38:07 2012 -0700

    [1747] minor editorial fixes: brace position, fold long lines, redundant space

commit cf5904a4ad2685c8923f4fbee1987132595908db
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Mar 12 20:53:18 2012 -0700

    [1747] cleanup: removed now-unnecessary const_ponter_cast.

commit 3d402d65a8aa0f271190b40f5e141c4e5ee7b31d
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Mon Mar 12 20:50:39 2012 -0700

    [1747] minor editorial fixes: unfold two short lines, brace position

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

Summary of changes:
 src/bin/auth/query.cc                |   71 +++++++++++++--------------------
 src/bin/auth/tests/query_unittest.cc |    8 ++--
 2 files changed, 32 insertions(+), 47 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/auth/query.cc b/src/bin/auth/query.cc
index 5e2935e..e79bef7 100644
--- a/src/bin/auth/query.cc
+++ b/src/bin/auth/query.cc
@@ -42,6 +42,11 @@ public:
         msg_(msg), section_(section), dnssec_(dnssec)
     {}
     void operator()(const ConstRRsetPtr& rrset) {
+        /*
+         * FIXME:
+         * The const-cast is wrong, but the Message interface seems
+         * to insist.
+         */
         msg_.addRRset(section_,
                       boost::const_pointer_cast<AbstractRRset>(rrset),
                       dnssec_);
@@ -98,13 +103,7 @@ Query::addSOA(ZoneFinder& finder) {
         isc_throw(NoSOA, "There's no SOA record in zone " <<
             finder.getOrigin().toText());
     } else {
-        /*
-         * FIXME:
-         * The const-cast is wrong, but the Message interface seems
-         * to insist.
-         */
-        authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               soa_ctx->rrset));
+        authorities_.push_back(soa_ctx->rrset);
     }
 }
 
@@ -123,7 +122,7 @@ Query::addNXDOMAINProofByNSEC(ZoneFinder& finder, ConstRRsetPtr nsec) {
     }
 
     // Add the NSEC proving NXDOMAIN to the authority section.
-    authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(nsec));
+    authorities_.push_back(nsec);
 
     // Next, identify the best possible wildcard name that would match
     // the query name.  It's the longer common suffix with the qname
@@ -160,8 +159,7 @@ Query::addNXDOMAINProofByNSEC(ZoneFinder& finder, ConstRRsetPtr nsec) {
     // stage of performance optimization, we should consider optimizing this
     // for some optimized data source implementations.
     if (nsec->getName() != fcontext->rrset->getName()) {
-        authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               fcontext->rrset));
+        authorities_.push_back(fcontext->rrset);
     }
 }
 
@@ -181,12 +179,10 @@ Query::addClosestEncloserProof(ZoneFinder& finder, const Name& name,
     }
 
     if (add_closest) {
-        authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               result.closest_proof));
+        authorities_.push_back(result.closest_proof);
     }
     if (result.next_proof) {
-        authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               result.next_proof));
+        authorities_.push_back(result.next_proof);
     }
     return (result.closest_labels);
 }
@@ -202,8 +198,7 @@ Query::addNSEC3ForName(ZoneFinder& finder, const Name& name, bool match) {
                   << (result.matched ? "matching" : "covering")
                   << " NSEC3 found for " << name);
     }
-    authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                           result.closest_proof));
+    authorities_.push_back(result.closest_proof);
 }
 
 void
@@ -238,8 +233,7 @@ Query::addWildcardProof(ZoneFinder& finder,
             isc_throw(BadNSEC,
                       "Unexpected NSEC result for wildcard proof");
         }
-        authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               fcontext->rrset));
+        authorities_.push_back(fcontext->rrset);
     } else if (db_context.isNSEC3Signed()) {
         // Case for RFC 5155 Section 7.2.6.
         //
@@ -269,8 +263,7 @@ Query::addWildcardNXRRSETProof(ZoneFinder& finder, ConstRRsetPtr nsec) {
    
     if (nsec->getName() != fcontext->rrset->getName()) {
         // one NSEC RR proves wildcard_nxrrset that no matched QNAME.
-        authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               fcontext->rrset));
+        authorities_.push_back(fcontext->rrset);
     }
 }
 
@@ -279,8 +272,7 @@ Query::addDS(ZoneFinder& finder, const Name& dname) {
     ConstZoneFinderContextPtr ds_context =
         finder.find(dname, RRType::DS(), dnssec_opt_);
     if (ds_context->code == ZoneFinder::SUCCESS) {
-        authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               ds_context->rrset));
+        authorities_.push_back(ds_context->rrset);
     } else if (ds_context->code == ZoneFinder::NXRRSET &&
                ds_context->isNSECSigned()) {
         addNXRRsetProof(finder, *ds_context);
@@ -299,8 +291,7 @@ Query::addNXRRsetProof(ZoneFinder& finder,
                        const ZoneFinder::Context& db_context)
 {
     if (db_context.isNSECSigned() && db_context.rrset) {
-        authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               db_context.rrset));
+        authorities_.push_back(db_context.rrset);
         if (db_context.isWildcard()) {
             addWildcardNXRRSETProof(finder, db_context.rrset);
         }
@@ -339,8 +330,7 @@ Query::addAuthAdditional(ZoneFinder& finder,
         isc_throw(NoApexNS, "There's no apex NS records in zone " <<
                   finder.getOrigin().toText());
     }
-    authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                           ns_context->rrset));
+    authorities_.push_back(ns_context->rrset);
     getAdditional(qname_, qtype_, *ns_context, additionals);
 }
 
@@ -363,7 +353,8 @@ findZone(const DataSourceClient& client, const Name& qname, RRType qtype) {
 void
 Query::process(datasrc::DataSourceClient& datasrc_client,
                const isc::dns::Name qname, const isc::dns::RRType qtype,
-               isc::dns::Message& response, bool dnssec) {
+               isc::dns::Message& response, bool dnssec)
+{
     // First a bit of house cleaning
     // The call to reset() could in theory be ommitted, but
     // seems prudent, just in case a previous process() left
@@ -416,8 +407,7 @@ Query::process(datasrc::DataSourceClient& datasrc_client,
     switch (db_context->code) {
         case ZoneFinder::DNAME: {
             // First, put the dname into the answer
-            answers_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               db_context->rrset));
+            answers_.push_back(db_context->rrset);
             /*
              * Empty DNAME should never get in, as it is impossible to
              * create one in master file.
@@ -466,8 +456,7 @@ Query::process(datasrc::DataSourceClient& datasrc_client,
              *
              * So, just put it there.
              */
-            answers_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                               db_context->rrset));
+            answers_.push_back(db_context->rrset);
 
             // If the answer is a result of wildcard substitution,
             // add a proof that there's no closer name.
@@ -478,8 +467,7 @@ Query::process(datasrc::DataSourceClient& datasrc_client,
         case ZoneFinder::SUCCESS:
             // If query type is ANY, the rrs have already been added
             if (!qtype_is_any) {
-                answers_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                                   db_context->rrset));
+                answers_.push_back(db_context->rrset);
             }
 
             // Retrieve additional records for the answer
@@ -514,8 +502,7 @@ Query::process(datasrc::DataSourceClient& datasrc_client,
             }
 
             response_->setHeaderFlag(Message::HEADERFLAG_AA, false);
-            authorities_.push_back(boost::const_pointer_cast<AbstractRRset>(
-                                   db_context->rrset));
+            authorities_.push_back(db_context->rrset);
             // Retrieve additional records for the name servers
             db_context->getAdditional(A_AND_AAAA(), additionals_);
 
@@ -556,29 +543,27 @@ Query::process(datasrc::DataSourceClient& datasrc_client,
 void
 Query::initialize(datasrc::DataSourceClient& datasrc_client,
                   const isc::dns::Name qname, const isc::dns::RRType qtype,
-                  isc::dns::Message& response, bool dnssec) {
+                  isc::dns::Message& response, bool dnssec)
+{
     datasrc_client_ = &datasrc_client;
     qname_ = qname;
     qtype_ = qtype;
     response_ = &response;
     dnssec_ = dnssec;
-    dnssec_opt_ = (dnssec ?  isc::datasrc::ZoneFinder::FIND_DNSSEC :
+    dnssec_opt_ = (dnssec ? isc::datasrc::ZoneFinder::FIND_DNSSEC :
                    isc::datasrc::ZoneFinder::FIND_DEFAULT);
 }
 
 void
 Query::createResponse() {
     for_each(answers_.begin(), answers_.end(),
-             RRsetInserter(*response_, Message::SECTION_ANSWER,
-                           dnssec_));
+             RRsetInserter(*response_, Message::SECTION_ANSWER, dnssec_));
     answers_.clear();
     for_each(authorities_.begin(), authorities_.end(),
-             RRsetInserter(*response_, Message::SECTION_AUTHORITY,
-                           dnssec_));
+             RRsetInserter(*response_, Message::SECTION_AUTHORITY, dnssec_));
     authorities_.clear();
     for_each(additionals_.begin(), additionals_.end(),
-             RRsetInserter(*response_, Message::SECTION_ADDITIONAL,
-                           dnssec_));
+             RRsetInserter(*response_, Message::SECTION_ADDITIONAL, dnssec_));
     additionals_.clear();
 }
 
diff --git a/src/bin/auth/tests/query_unittest.cc b/src/bin/auth/tests/query_unittest.cc
index 9b8c482..b74ebcc 100644
--- a/src/bin/auth/tests/query_unittest.cc
+++ b/src/bin/auth/tests/query_unittest.cc
@@ -2142,8 +2142,8 @@ TEST_F(QueryTest, dsNoZone) {
 // DS query for a "grandchild" zone.  This should result in normal
 // delegation (unless this server also has authority of the grandchild zone).
 TEST_F(QueryTest, dsAtGrandParent) {
-    query.process(memory_client, Name("grand.delegation.example.com"), RRType::DS(),
-                  response, true);
+    query.process(memory_client, Name("grand.delegation.example.com"),
+                  RRType::DS(), response, true);
     responseCheck(response, Rcode::NOERROR(), 0, 0, 6, 6, NULL,
                   (string(delegation_txt) + string(delegation_ds_txt) +
                    "delegation.example.com. 3600 IN RRSIG " +
@@ -2213,8 +2213,8 @@ TEST_F(QueryTest, nxrrsetWithNSEC3) {
 
     // NXRRSET with DNSSEC proof.  We should have SOA, NSEC3 that proves the
     // NXRRSET and their RRSIGs.
-    query.process(memory_client, Name("www.example.com"), RRType::TXT(), response,
-                  true);
+    query.process(memory_client, Name("www.example.com"), RRType::TXT(),
+                  response, true);
 
     responseCheck(response, Rcode::NOERROR(), AA_FLAG, 0, 4, 0, NULL,
                   (string(soa_txt) + string("example.com. 3600 IN RRSIG ") +



More information about the bind10-changes mailing list