BIND 10 master, updated. ecbfb7cf929d62a018dd4cdc7a841add3d5a35ae [master] Rename one interface: from lookupClosestRRset() to lookupDeepestNS(), and remove one parameter of it.
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Feb 22 09:11:37 UTC 2011
The branch, master has been updated
via ecbfb7cf929d62a018dd4cdc7a841add3d5a35ae (commit)
from 6689f461849841d7c5a724471107f758535c213e (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 ecbfb7cf929d62a018dd4cdc7a841add3d5a35ae
Author: zhanglikun <zhanglikun at cnnic.cn>
Date: Tue Feb 22 17:09:34 2011 +0800
[master] Rename one interface: from lookupClosestRRset() to lookupDeepestNS(), and remove one parameter of it.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 ++++
src/lib/cache/resolver_cache.cc | 7 ++---
src/lib/cache/resolver_cache.h | 29 +++++++++++------------
src/lib/cache/tests/resolver_cache_unittest.cc | 9 ++-----
4 files changed, 25 insertions(+), 25 deletions(-)
-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index d5ade55..6e46afb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+ 176. [func] zhang likun
+ src/lib/cache: Rename one interface: from lookupClosestRRset()
+ to lookupDeepestNS(), and remove one parameter of it.
+ (Trac #492, git)
+
175. [bug] jerry
src/bin/xfrout: Xfrout use the case-sensitive mode to compress
names in an AXFR massage.
diff --git a/src/lib/cache/resolver_cache.cc b/src/lib/cache/resolver_cache.cc
index 8f3fb0f..0734da8 100644
--- a/src/lib/cache/resolver_cache.cc
+++ b/src/lib/cache/resolver_cache.cc
@@ -175,10 +175,10 @@ ResolverCache::lookup(const isc::dns::Name& qname,
}
isc::dns::RRsetPtr
-ResolverCache::lookupClosestRRset(const isc::dns::Name& qname,
- const isc::dns::RRType& qtype,
- const isc::dns::RRClass& qclass) const
+ResolverCache::lookupDeepestNS(const isc::dns::Name& qname,
+ const isc::dns::RRClass& qclass) const
{
+ isc::dns::RRType qtype = RRType::NS();
ResolverClassCache* cc = getClassCache(qclass);
if (cc) {
unsigned int count = qname.getLabelCount();
@@ -199,7 +199,6 @@ ResolverCache::lookupClosestRRset(const isc::dns::Name& qname,
bool
ResolverCache::update(const isc::dns::Message& msg) {
-
QuestionIterator iter = msg.beginQuestion();
ResolverClassCache* cc = getClassCache((*iter)->getClass());
if (cc) {
diff --git a/src/lib/cache/resolver_cache.h b/src/lib/cache/resolver_cache.h
index 0c08b8c..a8149e4 100644
--- a/src/lib/cache/resolver_cache.h
+++ b/src/lib/cache/resolver_cache.h
@@ -241,28 +241,27 @@ public:
const isc::dns::RRType& qtype,
const isc::dns::RRClass& qclass) const;
- /// \brief Look up closest rrset in cache.
+ /// \brief Look up closest enclosing NS rrset in cache.
///
/// \param qname The query name to look up
- /// \param qtype The query type to look up
/// \param qclass The query class to look up
///
- /// \return return the shared_ptr of rrset if it can be found in
- /// cache, or else return NULL.
+ /// \return return the shared_ptr of closest enclosing ns rrset
+ /// if it can be found in cache, or else return NULL.
///
- /// Currently the implementation is: search exact rrset
- /// label by lable, If the rrset can't be found, remove the last
+ /// Currently the implementation is: search exact ns rrset
+ /// label by lable, If the ns rrset can't be found, remove the last
/// label, then search again. The efficiency may be very low when
- /// the name of rrset is very long but it's closest rrset's name
- /// is very short.
- /// If a good perfermance is needed when looking up the closest rrset,
- /// rrset cache structure(HashTable) should be redesigned. By using
- /// HashTable, it can only garantee the performance for looking
- /// up exact rrset.
+ /// the name is very long but it's closest rrset's name is very short.
+ ///
+ /// If a good perfermance is needed when looking up the closest
+ /// enclosing ns rrset, cache structure(HashTable) should be
+ /// redesigned. By using HashTable, it can only garantee the
+ /// performance for looking up exact rrset.
+ ///
/// So here there is another question, which rrset looking up interface
- /// is used frequently? Exact or closest looking up.
- isc::dns::RRsetPtr lookupClosestRRset(const isc::dns::Name& qname,
- const isc::dns::RRType& qtype,
+ /// is used frequently? Exact or closest enclosing ns looking up.
+ isc::dns::RRsetPtr lookupDeepestNS(const isc::dns::Name& qname,
const isc::dns::RRClass& qclass) const;
//@}
diff --git a/src/lib/cache/tests/resolver_cache_unittest.cc b/src/lib/cache/tests/resolver_cache_unittest.cc
index d36d289..7e97bd0 100644
--- a/src/lib/cache/tests/resolver_cache_unittest.cc
+++ b/src/lib/cache/tests/resolver_cache_unittest.cc
@@ -112,18 +112,15 @@ TEST_F(ResolverCacheTest, testLookupClosestRRset) {
Name qname("www.test.example.com.");
- RRsetPtr rrset_ptr = cache->lookupClosestRRset(qname, RRType::NS(),
- RRClass::IN());
+ RRsetPtr rrset_ptr = cache->lookupDeepestNS(qname, RRClass::IN());
EXPECT_TRUE(rrset_ptr);
EXPECT_EQ(rrset_ptr->getName(), Name("example.com."));
- rrset_ptr = cache->lookupClosestRRset(Name("example.com."),
- RRType::NS(), RRClass::IN());
+ rrset_ptr = cache->lookupDeepestNS(Name("example.com."), RRClass::IN());
EXPECT_TRUE(rrset_ptr);
EXPECT_EQ(rrset_ptr->getName(), Name("example.com."));
- rrset_ptr = cache->lookupClosestRRset(Name("com."),
- RRType::NS(), RRClass::IN());
+ rrset_ptr = cache->lookupDeepestNS(Name("com."), RRClass::IN());
EXPECT_FALSE(rrset_ptr);
}
More information about the bind10-changes
mailing list