BIND 10 trac495, updated. e1db14abce5e64985340e4ebb9eb4e7bee56763e [trac495] slightly modified cache storage

BIND 10 source code commits bind10-changes at lists.isc.org
Wed Mar 2 16:11:47 UTC 2011


The branch, trac495 has been updated
       via  e1db14abce5e64985340e4ebb9eb4e7bee56763e (commit)
      from  6483bb374e7ac88e3b736f08bf11e292605aaeef (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 e1db14abce5e64985340e4ebb9eb4e7bee56763e
Author: Jelte Jansen <jelte at isc.org>
Date:   Wed Mar 2 17:11:21 2011 +0100

    [trac495] slightly modified cache storage
    
    update the cache during the resolver process, and only if we get a delegation, or if we have a final answer

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

Summary of changes:
 src/lib/resolve/recursive_query.cc |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/resolve/recursive_query.cc b/src/lib/resolve/recursive_query.cc
index 9baa991..e0474d7 100644
--- a/src/lib/resolve/recursive_query.cc
+++ b/src/lib/resolve/recursive_query.cc
@@ -183,7 +183,7 @@ private:
         isc::resolve::initResponseMessage(question_, cached_message);
         if (cache_.lookup(question_.getName(), question_.getType(),
                           question_.getClass(), cached_message)) {
-            dlog("Message found in cache, returning that");
+            dlog("Message found in cache, continuing with that");
             // Should these be set by the cache too?
             cached_message.setOpcode(Opcode::QUERY());
             cached_message.setRcode(Rcode::NOERROR());
@@ -270,13 +270,12 @@ private:
         case isc::resolve::ResponseClassifier::ANSWERCNAME:
             // Done. copy and return.
             dlog("Response is an answer");
-            cache_.update(incoming);
             isc::resolve::copyResponseMessage(incoming, answer_message_);
+            cache_.update(*answer_message_);
             return true;
             break;
         case isc::resolve::ResponseClassifier::CNAME:
             dlog("Response is CNAME!");
-            cache_.update(incoming);
             // (unfinished) CNAME. We set our question_ to the CNAME
             // target, then start over at the beginning (for now, that
             // is, we reset our 'current servers' to the root servers).
@@ -301,10 +300,10 @@ private:
         case isc::resolve::ResponseClassifier::NXRRSET:
             dlog("Response is NXDOMAIN or NXRRSET");
             // NXDOMAIN, just copy and return.
-            // no negcache yet
-            //cache_.update(incoming);
             dlog(incoming.toText());
             isc::resolve::copyResponseMessage(incoming, answer_message_);
+            // no negcache yet
+            //cache_.update(*answer_message_);
             return true;
             break;
         case isc::resolve::ResponseClassifier::REFERRAL:
@@ -357,7 +356,6 @@ private:
         case isc::resolve::ResponseClassifier::RCODE:
         case isc::resolve::ResponseClassifier::TRUNCATED:
             dlog("Error in response, returning SERVFAIL");
-            std::cout << "Error: " << category << std::endl;
             // Should we try a different server rather than SERVFAIL?
             makeSERVFAIL();
             return true;
@@ -467,9 +465,6 @@ public:
             // does mean that we overwrite the messages we stored in
             // the previous iteration if we are following a delegation.
             if (success) {
-                if (answer_message_->getRcode() == Rcode::NOERROR()) {
-                    cache_.update(*answer_message_);
-                }
                 resolvercallback_->success(answer_message_);
             } else {
                 resolvercallback_->failure();




More information about the bind10-changes mailing list