Browse Source

[1607] use the result of findZone() to check if qname is zone origin.
This should be more efficient than expensive name comparison.
This is a small (unrelated) optimization, but hopefully it's okay.

JINMEI Tatuya 13 years ago
parent
commit
64611b9696
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/bin/auth/query.cc

+ 3 - 1
src/bin/auth/query.cc

@@ -503,7 +503,9 @@ Query::process() {
             // section, insert apex NS records into the authority section
             // and AAAA/A RRS of each of the NS RDATA into the additional
             // section.
-            if (qname_ != result.zone_finder->getOrigin() ||
+            // Checking the findZone() is a lightweight check to see if
+            // qname is the zone origin.
+            if (result.code != result::SUCCESS ||
                 db_context->code != ZoneFinder::SUCCESS ||
                 (qtype_ != RRType::NS() && !qtype_is_any))
             {