Commit e30dfe31 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[1198] applied proposed further refactoring: extracted the common logic

for the positive case to a separate method and used it directly from find()
and findWildcardMatch().  Moved detailed comments of findWildcardMatch to
the head of its definition so that the function body will be physically
concise.
parent 52802deb
This diff is collapsed.
......@@ -921,6 +921,14 @@ public:
const isc::dns::RRType& type, const FindOptions options,
const DelegationSearchResult& dresult);
/// \brief Handle matching results for name
FindResult findOnNameResult(const isc::dns::Name& name,
const isc::dns::RRType& type,
const FindOptions options,
const bool is_origin,
const FoundRRsets& found,
const std::string* wildname);
/// \brief Handle no match for name
///
/// This is called when it is known that there is no delegation and
......@@ -956,11 +964,13 @@ public:
/// Logs condition and creates result
///
/// A convenience function used by find(), it both creates the
/// FindResult object that find() will return to its caller as well
/// A convenience function used by findOnNameResult(), it both creates
/// the FindResult object that find() will return to its caller as well
/// as logging a debug message for the information being returned.
///
/// \param name Domain name of the RR that was being sought.
/// \param wildname Domain name string of a matched wildcard name or
/// NULL for non wildcard match.
/// \param type Type of RR being sought.
/// \param code Result of the find operation
/// \param rrset RRset found as a result of the find (which may be
......@@ -974,10 +984,11 @@ public:
/// \return FindResult object constructed from the code and rrset
/// arguments.
FindResult logAndCreateResult(const isc::dns::Name& name,
const std::string* wildname,
const isc::dns::RRType& type,
ZoneFinder::Result code,
isc::dns::ConstRRsetPtr rrset,
const isc::log::MessageID& log_id);
const isc::log::MessageID& log_id) const;
/// \brief Checks if something lives below this domain.
///
......
......@@ -78,7 +78,7 @@ different TTL values. This isn't allowed on the wire and is considered
an error, so we set it to the lowest value we found (but we don't modify the
database). The data in database should be checked and fixed.
% DATASRC_DATABASE_FOUND_CNAME search in datasource %1 for %2/%3/%4 found CNAME
% DATASRC_DATABASE_FOUND_CNAME search in datasource %1 for %2/%3/%4 found CNAME, resulting in %5
When searching the domain for a name a CNAME was found at that name.
Even though it was not the RR type being sought, it is returned. (The
caller may want to continue the lookup by replacing the query name with
......@@ -108,7 +108,7 @@ non-terminal" and so we return NXRRSET instead of NXDOMAIN.
The data returned by the database backend did not contain any data for the given
domain name, class and type.
% DATASRC_DATABASE_FOUND_NXRRSET search in datasource %1 resulted in NXRRSET for %2/%3/%4
% DATASRC_DATABASE_FOUND_NXRRSET search in datasource %1 for %2/%3/%4 resulted in NXRRSET
The data returned by the database backend contained data for the given domain
name and class, but not for the given type.
......@@ -190,7 +190,7 @@ exists, therefore this name is something like empty non-terminal (actually,
from the protocol point of view, it is empty non-terminal, but the code
discovers it differently).
% DATASRC_DATABASE_WILDCARD_CNAME found CNAME at %2 which is a wildcard match for %3 in %1
% DATASRC_DATABASE_WILDCARD_CNAME search in datasource %1 for %2/%3/%4 found wildcard CNAME at %5, resulting in %6
The database doesn't contain directly matching name. When searching
for a wildcard match, a CNAME RR was found at a wildcard record
matching the name. This is returned as the result of the search.
......@@ -201,17 +201,17 @@ nonterminal (e.g. there's nothing at *.example.com but something like
subdomain.*.example.org, do exist: so *.example.org exists in the
namespace but has no RRs assopciated with it). This will produce NXRRSET.
% DATASRC_DATABASE_WILDCARD_MATCH found match at %2 which is a wildcard match for %3 in %1
% DATASRC_DATABASE_WILDCARD_MATCH search in datasource %1 resulted in wildcard match at %5 with RRset %6
The database doesn't contain directly matching name. When searching
for a wildcard match, a wildcard record matching the name and type of
the query was found. The data at this point is returned.
% DATASRC_DATABASE_WILDCARD_NS found NS at %2 which is a wildcard match for %3 in %1
% DATASRC_DATABASE_WILDCARD_NS search in datasource %1 for %2/%3/%4 found wildcard delegation at %5, resulting in %6
The database doesn't contain directly matching name. When searching
for a wildcard match, an NS RR was found at a wildcard record matching
the name. This is returned as the result of the search.
% DATASRC_DATABASE_WILDCARD_NXRRSET found no data at %2 which is a wildcard match for %3 in %1
% DATASRC_DATABASE_WILDCARD_NXRRSET search in datasource %1 for %2/%3/%4 resulted in wildcard NXRRSET at %5
The database doesn't contain directly matching name. When searching
for a wildcard match, a matching wildcard entry was found but it did
not contain RRs the requested type. AN NXRRSET indication is returned.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment