BIND 10 master, updated. 728f0af26952a8e684be96c73567defbe81052ab [master] Fix the minor problem brought on by merging trac493: the blank space in changelog and EOL, add the unmerged test case of message cache.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Mar 14 12:07:48 UTC 2011


The branch, master has been updated
       via  728f0af26952a8e684be96c73567defbe81052ab (commit)
      from  9ea1252c6694bd933049e0629cae3d2d4a1cd47e (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 728f0af26952a8e684be96c73567defbe81052ab
Author: zhanglikun <zhanglikun at cnnic.cn>
Date:   Mon Mar 14 20:07:33 2011 +0800

    [master] Fix the minor problem brought on by merging trac493: the blank space in changelog and EOL, add the unmerged test case of message cache.

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

Summary of changes:
 ChangeLog                                     |    6 +++---
 src/lib/cache/message_entry.h                 |    2 +-
 src/lib/cache/message_utility.cc              |    2 +-
 src/lib/cache/message_utility.h               |    2 +-
 src/lib/cache/resolver_cache.h                |    6 +++---
 src/lib/cache/tests/message_cache_unittest.cc |    9 +++++++--
 6 files changed, 16 insertions(+), 11 deletions(-)

-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 039f09d..4294904 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
   199.  [func]           ocean
-        Cache negative responses (NXDOMAIN/NODATA) from authoritative
-        server for recursive resolver.
-        (Trac #493, git f8fb852bc6aef292555063590c361f01cf29e5ca)
+	Cache negative responses (NXDOMAIN/NODATA) from authoritative
+	server for recursive resolver.
+	(Trac #493, git f8fb852bc6aef292555063590c361f01cf29e5ca)
 
   198.	[bug]		jinmei
 	b10-auth, src/lib/datasrc: fixed a bug where hot spot cache failed
diff --git a/src/lib/cache/message_entry.h b/src/lib/cache/message_entry.h
index a2c15f9..7d86495 100644
--- a/src/lib/cache/message_entry.h
+++ b/src/lib/cache/message_entry.h
@@ -69,7 +69,7 @@ public:
     ///        since some new rrset entries may be inserted into
     ///        rrset cache, or the existed rrset entries need
     ///        to be updated.
-    /// \param negative_soa_cache the pointer of RRsetCAche. This
+    /// \param negative_soa_cache the pointer of RRsetCache. This
     ///        cache is used only for storing SOA rrset from negative
     ///        response (NXDOMAIN or NOERROR_NODATA)
     MessageEntry(const isc::dns::Message& message,
diff --git a/src/lib/cache/message_utility.cc b/src/lib/cache/message_utility.cc
index 4b85fef..53a3352 100644
--- a/src/lib/cache/message_utility.cc
+++ b/src/lib/cache/message_utility.cc
@@ -50,7 +50,7 @@ isNegativeResponse(const isc::dns::Message& msg) {
     } else if (msg.getRcode() == Rcode::NOERROR()) {
         // no data in the answer section
         if (msg.getRRCount(Message::SECTION_ANSWER) == 0) {
-            // NODATA type 1/ type 2 (ref sec2.2 of RFC2308) 
+            // NODATA type 1/ type 2 (ref sec2.2 of RFC2308)
             if (hasTheRecordInAuthoritySection(msg, RRType::SOA())) {
                 return (true);
             } else if (!hasTheRecordInAuthoritySection(msg, RRType::NS())) {
diff --git a/src/lib/cache/message_utility.h b/src/lib/cache/message_utility.h
index b15eddf..a77af07 100644
--- a/src/lib/cache/message_utility.h
+++ b/src/lib/cache/message_utility.h
@@ -25,7 +25,7 @@ namespace cache {
 /// \brief Some utility functions to extract info from message
 ///
 /// We need to check the message before cache it, for example, if no SOA
-/// record is found in the Authority section of NXDOMAIN response, the 
+/// record is found in the Authority section of NXDOMAIN response, the
 /// message cannot be cached
 namespace MessageUtility{
 
diff --git a/src/lib/cache/resolver_cache.h b/src/lib/cache/resolver_cache.h
index 0ec200c..49818b5 100644
--- a/src/lib/cache/resolver_cache.h
+++ b/src/lib/cache/resolver_cache.h
@@ -135,8 +135,8 @@ public:
     ///       the right class
     /// TODO: Share the NXDOMAIN info between different type queries
     ///       current implementation can only cache for the type that
-    ///       user quired, for example, if user query A record of 
-    ///       a.example. and the server replied with NXDOMAIN, this 
+    ///       user quired, for example, if user query A record of
+    ///       a.example. and the server replied with NXDOMAIN, this
     ///       should be cached for all the types queries of a.example.
     bool update(const isc::dns::Message& msg);
 
@@ -161,7 +161,7 @@ public:
     ///
     /// \return The RRClass of this cache
     const isc::dns::RRClass& getClass() const;
-    
+
 private:
     /// \brief Update rrset cache.
     ///
diff --git a/src/lib/cache/tests/message_cache_unittest.cc b/src/lib/cache/tests/message_cache_unittest.cc
index e251581..fc62e21 100644
--- a/src/lib/cache/tests/message_cache_unittest.cc
+++ b/src/lib/cache/tests/message_cache_unittest.cc
@@ -70,7 +70,7 @@ public:
                         message_render(Message::RENDER)
     {
         uint16_t class_ = RRClass::IN().getCode();
-        rrset_cache_.reset(new RRsetCache(RRSET_CACHE_DEFAULT_SIZE, class_));
+        rrset_cache_.reset(new DerivedRRsetCache(RRSET_CACHE_DEFAULT_SIZE, class_));
         negative_soa_cache_.reset(new RRsetCache(NEGATIVE_RRSET_CACHE_DEFAULT_SIZE, class_));
         // Set the message cache size to 1, make it easy for unittest.
         message_cache_.reset(new DerivedMessageCache(rrset_cache_, 1, class_,
@@ -79,7 +79,7 @@ public:
 
 protected:
     boost::shared_ptr<DerivedMessageCache> message_cache_;
-    RRsetCachePtr rrset_cache_;
+    boost::shared_ptr<DerivedRRsetCache> rrset_cache_;
     RRsetCachePtr negative_soa_cache_;
     Message message_parse;
     Message message_render;
@@ -110,6 +110,11 @@ TEST_F(MessageCacheTest, testLookup) {
     Name qname1("test.example.net.");
     EXPECT_TRUE(message_cache_->lookup(qname1, RRType::A(), message_render));
 
+    // Test looking up message which has expired rrset or some rrset
+    // has been removed from the rrset cache.
+    rrset_cache_->removeRRsetEntry(qname1, RRType::A());
+    EXPECT_FALSE(message_cache_->lookup(qname1, RRType::A(), message_render));
+
     // Update one message entry which has expired to message cache.
     updateMessageCache("message_fromWire9", message_cache_);
     EXPECT_EQ(message_cache_->messages_count(), 3);




More information about the bind10-changes mailing list