[svn] commit: r886 - in /branches/each-ds/src/lib/auth/cpp: TODO data_source.cc query.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Sat Feb 20 00:47:20 UTC 2010
Author: each
Date: Sat Feb 20 00:47:19 2010
New Revision: 886
Log:
checkpoint:
- additional section data now comes before RRSIGs, so that the RRSIGs
can be dropped if necessary for space reasons
- additional section data is left out if Query.want_additional is false.
Modified:
branches/each-ds/src/lib/auth/cpp/TODO
branches/each-ds/src/lib/auth/cpp/data_source.cc
branches/each-ds/src/lib/auth/cpp/query.h
Modified: branches/each-ds/src/lib/auth/cpp/TODO
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/TODO (original)
+++ branches/each-ds/src/lib/auth/cpp/TODO Sat Feb 20 00:47:19 2010
@@ -1,18 +1,7 @@
Data source:
- change filenames so we don't have everything starting with "data_source_"?
-- should check want_additional before adding additional data (except for
- referrals)
- make sure glue is not returned in additional section except for NS.
we need a way to indicate "glue OK" in calls to findExactRRset().
-
-DNSSEC:
-- add at least minimal EDNS0 support sufficient to recognize the DO bit
-- implement NSEC rdata type; add NSEC/NSEC3 to authority section in
- negative answers (including positive wildcard answers)
-- instead of adding additional data directly to the reply message,
- add it to a temporary storage space, then copy it to the reply
- afterward, so that A records can be included and RRSIGs omitted if
- necessary
SQL data source optimization and cleanup:
- should implement findAddrs() and findReferral() directly instead of
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 20 00:47:19 2010
@@ -19,6 +19,10 @@
static void
getAdditional(Query& q, RRsetPtr rrset) {
+ if (!q.wantAdditional()) {
+ return;
+ }
+
RdataIteratorPtr it = rrset->getRdataIterator();
for (it->first(); !it->isLast(); it->next()) {
const Rdata& rd(it->getCurrent());
@@ -119,6 +123,7 @@
DataSrc::doQuery(Query q) {
Result result;
Message& m = q.message();
+ RRsetList additional;
// XXX: this is for testing purposes; it should be done when
// parsing the message for EDNS0 options
@@ -274,15 +279,30 @@
continue;
case QueryTask::GETADDITIONAL:
+ // Got additional data. Do not add it to the message
+ // yet; instead store it and copy it in at the end.
BOOST_FOREACH(RRsetPtr rrset, data) {
if (q.status() == Query::ANSWERED &&
rrset->getName() == q.qname() &&
rrset->getType() == q.qtype()) {
continue;
}
- m.addRRset(task.section, rrset, q.wantDnssec());
+ additional.addRRset(rrset);
}
if (q.tasks().empty()) {
+ // We're done, so now copy in the additional data:
+ // data first, then signatures. (If we run out of
+ // space, signatures in additional section are
+ // optional.)
+ BOOST_FOREACH(RRsetPtr rrset, additional) {
+ m.addRRset(Section::AUTHORITY(), rrset, false);
+ }
+ if (q.wantDnssec()) {
+ BOOST_FOREACH(RRsetPtr rrset, additional) {
+ m.addRRset(Section::AUTHORITY(),
+ rrset->getRRsig(), false);
+ }
+ }
q.setStatus(Query::SUCCESS);
return;
}
Modified: branches/each-ds/src/lib/auth/cpp/query.h
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/query.h (original)
+++ branches/each-ds/src/lib/auth/cpp/query.h Sat Feb 20 00:47:19 2010
@@ -191,8 +191,6 @@
status_ = RUNNING;
// Check message formatting
- // (XXX: The Message API should have a method for getting
- // section counts without having to use an iterator)
if (message_->getRRCount(Section::QUESTION()) != 1) {
dns_throw(Unexpected, "malformed message: too many questions");
}
More information about the bind10-changes
mailing list