[svn] commit: r812 - /branches/each-ds/src/lib/auth/cpp/data_source.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Sat Feb 13 17:34:41 UTC 2010


Author: each
Date: Sat Feb 13 17:34:41 2010
New Revision: 812

Log:
checkpoint:
 - slight optimization: fetch NS for enclosing zone directly from the
   data source that is already known to be authoritative, rather than 
   doing another loop through findClosestEnclosure()

Modified:
    branches/each-ds/src/lib/auth/cpp/data_source.cc

Modified: branches/each-ds/src/lib/auth/cpp/data_source.cc
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/data_source.cc (original)
+++ branches/each-ds/src/lib/auth/cpp/data_source.cc Sat Feb 13 17:34:41 2010
@@ -98,14 +98,23 @@
             case QueryTask::FOLLOWCNAME:
                 getAdditional(q, data[0]);
                 if (q.tasks().empty()) {
-                    // No additional processing is needed, so now
-                    // add the authority section.
+                    // Data found, no additional processing needed.
+                    // Add the NS records for the enclosing zone to
+                    // the authority section.
                     if (data[0]->getType() != RRType::NS()) {
-                        QueryTask t(Name(*zone), task.qclass,
-                                     RRType::NS(),
-                                     Section::AUTHORITY());
-                        t.state = QueryTask::GETAUTHORITY;
-                        q.tasks().push(t);
+                        RRsetList auth, asigs;
+                        result = ds->findRRset(q, Name(*zone), task.qclass,
+                                               RRType::NS(), auth, asigs);
+                        if (result != SUCCESS) {
+                            m.setRcode(Rcode::SERVFAIL());
+                            return;
+                        }
+
+                        m.addRRset(Section::AUTHORITY(), auth[0]);
+                        if (q.wantDnssec() && asigs.size() == 1) {
+                            m.addRRset(Section::AUTHORITY(), asigs[0]);
+                        }
+                        getAdditional(q, auth[0]);
                     }
                 }
                 continue;




More information about the bind10-changes mailing list