BIND 10 trac1722, updated. 5c78e914c502d1462fa4e99aa3213a48e3e8bb8d [1722] find_last does not need argument now

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Feb 29 10:08:28 UTC 2012


The branch, trac1722 has been updated
       via  5c78e914c502d1462fa4e99aa3213a48e3e8bb8d (commit)
      from  7b92c815b458b3fb4011fede59b787391bec7058 (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 5c78e914c502d1462fa4e99aa3213a48e3e8bb8d
Author: Jelte Jansen <jelte at isc.org>
Date:   Wed Feb 29 11:08:15 2012 +0100

    [1722] find_last does not need argument now

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

Summary of changes:
 src/bin/auth/auth_srv.cc  |   22 ++++++++++++++++++++--
 src/lib/dns/masterload.cc |    2 +-
 2 files changed, 21 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index 1487e13..10a8233 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -511,6 +511,16 @@ AuthSrv::processMessage(const IOMessage& io_message, MessagePtr message,
     impl_->resumeServer(server, message, send_answer);
 }
 
+namespace {
+DataSourceClient::FindResult
+findZone(const DataSourceClient& client, const Name& qname, RRType qtype) {
+    if (qtype != RRType::DS() || qname.getLabelCount() == 1) {
+        return (client.findZone(qname));
+    }
+    return (client.findZone(qname.split(1)));
+}
+}
+
 bool
 AuthSrvImpl::processNormalQuery(const IOMessage& io_message, MessagePtr message,
                                 OutputBufferPtr buffer,
@@ -542,8 +552,16 @@ AuthSrvImpl::processNormalQuery(const IOMessage& io_message, MessagePtr message,
         if (memory_client_ && memory_client_class_ == question->getClass()) {
             const RRType& qtype = question->getType();
             const Name& qname = question->getName();
-            auth::Query(*memory_client_, qname, qtype, *message,
-                        dnssec_ok).process();
+            const DataSourceClient::FindResult result = findZone(*memory_client_,
+                                                     qname, qtype);
+            if (result.code != result::SUCCESS &&
+                result.code != result::PARTIALMATCH) {
+                datasrc::Query query(*message, cache_, dnssec_ok);
+                data_sources_.doQuery(query);
+            } else {
+                auth::Query(*memory_client_, qname, qtype, *message,
+                            dnssec_ok).process();
+            }
         } else {
             datasrc::Query query(*message, cache_, dnssec_ok);
             data_sources_.doQuery(query);
diff --git a/src/lib/dns/masterload.cc b/src/lib/dns/masterload.cc
index fbbae6e..6f1e236 100644
--- a/src/lib/dns/masterload.cc
+++ b/src/lib/dns/masterload.cc
@@ -55,7 +55,7 @@ stripLine(string& s, const Exception& ex) {
         s.resize(pos_semicolon);
     }
     // Remove any trailing whitespace return the resulting text.
-    s.resize(s.find_last_not_of(" /t", s.size()) + 1);
+    s.resize(s.find_last_not_of(" /t") + 1);
     return (s);
 }
 }



More information about the bind10-changes mailing list