BIND 10 trac661, updated. 5ecd1322b677fa9808125986a65b28d619c79120 [trac661] Change the lru touch behavior, don't touch it if the rrset entry has expired.

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Mar 8 08:45:52 UTC 2011


The branch, trac661 has been updated
       via  5ecd1322b677fa9808125986a65b28d619c79120 (commit)
      from  78828990b58d0b791f94ed2441bf1267f81d58d3 (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 5ecd1322b677fa9808125986a65b28d619c79120
Author: zhanglikun <zhanglikun at cnnic.cn>
Date:   Tue Mar 8 16:45:47 2011 +0800

    [trac661] Change the lru touch behavior, don't touch it if the rrset entry has expired.

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

Summary of changes:
 src/lib/cache/rrset_cache.cc |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/cache/rrset_cache.cc b/src/lib/cache/rrset_cache.cc
index 97c2b64..b5548b4 100644
--- a/src/lib/cache/rrset_cache.cc
+++ b/src/lib/cache/rrset_cache.cc
@@ -42,11 +42,13 @@ RRsetCache::lookup(const isc::dns::Name& qname,
 {
     const string entry_name = genCacheEntryName(qname, qtype);
     RRsetEntryPtr entry_ptr = rrset_table_.get(HashKey(entry_name, RRClass(class_)));
-    if (entry_ptr) {
+    if (entry_ptr && entry_ptr->getExpireTime() > time(NULL)) {
+        // Only touch the non-expired rrset entries
         rrset_lru_.touch(entry_ptr);
+        return (entry_ptr);
     }
 
-    return (entry_ptr);
+    return (RRsetEntryPtr());
 }
 
 RRsetEntryPtr
@@ -56,8 +58,7 @@ RRsetCache::update(const isc::dns::RRset& rrset, const RRsetTrustLevel& level) {
     RRsetEntryPtr entry_ptr = lookup(rrset.getName(), rrset.getType());
     if (entry_ptr) {
         if (entry_ptr->getTrustLevel() > level) {
-            // existed rrset entry is more authoritative, touch and return it
-            rrset_lru_.touch(entry_ptr);
+            // existed rrset entry is more authoritative, just return it
             return (entry_ptr);
         } else {
             // Remove the old rrset entry from the lru list.




More information about the bind10-changes mailing list