BIND 10 trac505, updated. f9a11dcba2da26e3a27a4be00461aea07aa60d85 [trac505] added some comments about dname.example.com for the mock zone.

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Feb 11 06:36:12 UTC 2011


The branch, trac505 has been updated
       via  f9a11dcba2da26e3a27a4be00461aea07aa60d85 (commit)
       via  a43d8d0ef4cd44d5e0ab9fa9fc746e6d1ff353e0 (commit)
       via  495087240c7b5736999e3edca697eb8509068ca3 (commit)
      from  073d75e7ab64ff107198181cbc9ef4482e83b681 (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 f9a11dcba2da26e3a27a4be00461aea07aa60d85
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Feb 10 22:35:46 2011 -0800

    [trac505] added some comments about dname.example.com for the mock zone.

commit a43d8d0ef4cd44d5e0ab9fa9fc746e6d1ff353e0
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Feb 10 16:32:28 2011 -0800

    [trac505] indentation fixes

commit 495087240c7b5736999e3edca697eb8509068ca3
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Thu Feb 10 16:25:30 2011 -0800

    [trac505] consitified variables as much as possible.
    
    note: qtype_is_any was originally const, and was temporarily changed to
    mutable.  it's now immutable again.

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

Summary of changes:
 src/bin/auth/query.cc                |   16 ++++++++--------
 src/bin/auth/tests/query_unittest.cc |    6 ++++--
 2 files changed, 12 insertions(+), 10 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/auth/query.cc b/src/bin/auth/query.cc
index 3b98746..461a329 100644
--- a/src/bin/auth/query.cc
+++ b/src/bin/auth/query.cc
@@ -122,7 +122,7 @@ Query::getAuthAdditional(const Zone& zone) const {
 void
 Query::process() const {
     bool keep_doing = true;
-    bool qtype_is_any = (qtype_ == RRType::ANY());
+    const bool qtype_is_any = (qtype_ == RRType::ANY());
 
     response_.setHeaderFlag(Message::HEADERFLAG_AA, false);
     const MemoryDataSrc::FindResult result =
@@ -145,7 +145,7 @@ Query::process() const {
     while (keep_doing) {
         keep_doing = false;
         std::auto_ptr<RRsetList> target(qtype_is_any ? new RRsetList : NULL);
-        Zone::FindResult db_result(result.zone->find(qname_, qtype_,
+        const Zone::FindResult db_result(result.zone->find(qname_, qtype_,
             target.get()));
 
         switch (db_result.code) {
@@ -165,7 +165,7 @@ Query::process() const {
                     dynamic_cast<const rdata::generic::DNAME&>(
                     db_result.rrset->getRdataIterator()->getCurrent()));
                 // The yet unmatched prefix dname
-                Name prefix(qname_.split(0, qname_.getLabelCount() -
+                const Name prefix(qname_.split(0, qname_.getLabelCount() -
                     db_result.rrset->getName().getLabelCount()));
                 // If we put it together, will it be too long?
                 // (The prefix contains trailing ., which will be removed
@@ -173,10 +173,10 @@ Query::process() const {
                     dname.getDname().getLength() > Name::MAX_WIRE ||
                     prefix.getLabelCount() - Name(".").getLabelCount() +
                     dname.getDname().getLabelCount() > Name::MAX_LABELS) {
-                /*
-                 * In case the synthetized name is too long, section 4.1 of RFC
-                 * 2672 mandates we return YXDOMAIN.
-                 */
+                    /*
+                     * In case the synthesized name is too long, section 4.1
+                     * of RFC 2672 mandates we return YXDOMAIN.
+                     */
                     response_.setRcode(Rcode::YXDOMAIN());
                     return;
                 }
@@ -184,7 +184,7 @@ Query::process() const {
                 // with DNSSEC, the DNAME is signed and it can be validated
                 // by that)
                 RRsetPtr cname(new RRset(qname_, db_result.rrset->getClass(),
-                RRType::CNAME(), db_result.rrset->getTTL()));
+                    RRType::CNAME(), db_result.rrset->getTTL()));
                 // Construct the new target by replacing the end
                 cname->addRdata(rdata::generic::CNAME(qname_.split(0,
                     qname_.getLabelCount() -
diff --git a/src/bin/auth/tests/query_unittest.cc b/src/bin/auth/tests/query_unittest.cc
index ced47fe..e5a885a 100644
--- a/src/bin/auth/tests/query_unittest.cc
+++ b/src/bin/auth/tests/query_unittest.cc
@@ -99,8 +99,10 @@ const char* const other_zone_rrs =
 // behavior.
 // For simplicity, most names are assumed to be "in zone"; there's only
 // one zone cut at the point of name "delegation.example.com".
-// It doesn't handle empty non terminal nodes (if we need to test such cases
-// find() should have specialized code for it).
+// Another special name is "dname.example.com".  Query names under this name
+// will result in DNAME.
+// This mock zone doesn't handle empty non terminal nodes (if we need to test
+// such cases find() should have specialized code for it).
 class MockZone : public Zone {
 public:
     MockZone() :




More information about the bind10-changes mailing list