[svn] commit: r857 - in /branches/each-ds/src/lib/auth/cpp: data_source.cc data_source.h data_source_sqlite3.cc data_source_sqlite3.h data_source_static.cc data_source_static.h query.cc query.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Feb 17 23:16:55 UTC 2010
Author: each
Date: Wed Feb 17 23:16:54 2010
New Revision: 857
Log:
- findRRset(), findExactRRset() and friends no longer take a "sigs"
argument for signatures; instead they're attached directly to the
target rrset via addRRsig()
- they do, however, now take a uint32_t "flags" argument so that they
can return information about conditions encountered during query.
(this information used to be passed back via the return code, but
it turns out sometimes you need to report more than one condition
at the same time--for example, REFERRAL and TYPE_NOT_FOUND.)
- DataSrc::doQuery() modified to make use of the above changes
Modified:
branches/each-ds/src/lib/auth/cpp/data_source.cc
branches/each-ds/src/lib/auth/cpp/data_source.h
branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.cc
branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.h
branches/each-ds/src/lib/auth/cpp/data_source_static.cc
branches/each-ds/src/lib/auth/cpp/data_source_static.h
branches/each-ds/src/lib/auth/cpp/query.cc
branches/each-ds/src/lib/auth/cpp/query.h
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 Wed Feb 17 23:16:54 2010
@@ -93,23 +93,22 @@
}
DataSrc::Result
-doQueryTask(const DataSrc* ds, Query q, QueryTask task, RRsetList& target) {
- RRsetList sigs; // XXX: only needed until the lower-level api changes
-
+doQueryTask(const DataSrc* ds, Query& q, QueryTask& task, RRsetList& target) {
switch (task.op) {
case QueryTask::AUTH_QUERY:
return (ds->findRRset(q, task.qname, task.qclass, task.qtype,
- target, sigs));
+ target, task.flags));
case QueryTask::SIMPLE_QUERY:
return (ds->findExactRRset(q, task.qname, task.qclass, task.qtype,
- target, sigs));
+ target, task.flags));
case QueryTask::ADDR_QUERY:
- return (ds->findAddrs(q, task.qname, task.qclass, target, sigs));
+ return (ds->findAddrs(q, task.qname, task.qclass, target, task.flags));
case QueryTask::REF_QUERY:
- return (ds->findReferral(q, task.qname, task.qclass, target, sigs));
+ return (ds->findReferral(q, task.qname, task.qclass, target,
+ task.flags));
}
}
@@ -126,7 +125,7 @@
m.clearHeaderFlag(MessageFlag::AA());
while (!q.tasks().empty()) {
RdataIteratorPtr it;
- RRsetList data, sigs;
+ RRsetList data;
QueryTask task = q.tasks().front();
q.tasks().pop();
@@ -146,7 +145,7 @@
const Name* zone = match.closestName();
if (ds == NULL) {
- result = ZONE_NOT_FOUND;
+ task.flags = NO_SUCH_ZONE;
} else {
if (task.op == QueryTask::AUTH_QUERY) {
// If this is an authoritative query and there is more than
@@ -163,7 +162,7 @@
QueryTask t(task.qname.split(i - 1, nlen - i),
task.qclass, QueryTask::REF_QUERY);
result = doQueryTask(ds, q, t, ref);
- if (result == SUCCESS) {
+ if (result == SUCCESS && t.flags == 0) {
found = true;
break;
}
@@ -200,23 +199,15 @@
}
result = doQueryTask(ds, q, task, data);
- if (result == REFERRAL_FOUND) {
- if (zone->getLabelCount() == task.qname.getLabelCount()) {
- // An NS at the zone apex is expected.
- result = SUCCESS;
- }
+ if (result == SUCCESS && (task.flags & REFERRAL) &&
+ (zone->getLabelCount() == task.qname.getLabelCount())) {
+ // An NS found at the zone apex is expected.
+ task.flags &= ~REFERRAL;
}
}
- bool have_ns = false;
-
- switch (result) {
- case SUCCESS:
- // XXX: This will need to be able to handle multiple RRsets
- // once RRType ANY is supported. For right now, however, we
- // can assume that an auth query that reaches this point has
- // only one RRset: either the data requested, or a CNAME.
-
+ if (result == SUCCESS && task.flags == 0) {
+ bool have_ns = false;
switch (task.state) {
case QueryTask::GETANSWER:
case QueryTask::FOLLOWCNAME:
@@ -271,8 +262,11 @@
default:
dns_throw (Unexpected, "unexpected query state");
}
-
- case CNAME_FOUND:
+ } else if (result == ERROR || result == NOT_IMPLEMENTED) {
+ m.setRcode(Rcode::SERVFAIL());
+ q.setStatus(Query::FAILURE);
+ return;
+ } else if (task.flags & CNAME_FOUND) {
// The qname node contains a CNAME. Add a new task to the
// queue to look up its target.
if (RRsetPtr rrset = data[RRType::CNAME()]) {
@@ -280,8 +274,7 @@
chaseCname(q, task, rrset);
}
continue;
-
- case REFERRAL_FOUND:
+ } else if (task.flags & REFERRAL) {
// The qname node contains an out-of-zone referral.
if (task.state == QueryTask::GETANSWER) {
RRsetList auth;
@@ -301,9 +294,17 @@
}
}
continue;
-
- case NAME_NOT_FOUND:
- case TYPE_NOT_FOUND:
+ } else if (task.flags & NO_SUCH_ZONE) {
+ // No such zone. If we're chasing cnames or adding additional
+ // data, that's okay, but if doing an original query, return
+ // REFUSED.
+ if (task.state == QueryTask::GETANSWER) {
+ m.setRcode(Rcode::REFUSED());
+ q.setStatus(Query::FAILURE);
+ return;
+ }
+ continue;
+ } else if (task.flags & (NAME_NOT_FOUND|TYPE_NOT_FOUND)) {
// No data found at this qname. If we were looking for answer
// data, we need to check to see if there are any relevant
// wildcards.
@@ -316,6 +317,7 @@
bool found = false;
RRsetList wild;
Name star("*");
+ uint32_t rflags = 0;
for(int i = 1; i <= diff; i++) {
const Name& wname(star.concatenate(task.qname.split(i,
@@ -323,7 +325,9 @@
QueryTask t(wname, task.qclass, task.qtype,
QueryTask::SIMPLE_QUERY);
r = doQueryTask(ds, q, t, wild);
- if (r == SUCCESS || r == CNAME_FOUND) {
+ if (r == SUCCESS &&
+ (t.flags == 0 || (t.flags & CNAME_FOUND))) {
+ rflags = t.flags;
found = true;
break;
}
@@ -339,7 +343,7 @@
// only be one rrset returned in wild. But
// eventually this will need to handle ANY queries,
// so wrap it in a BOOST_FOREACH statement anyway.
- if (r == CNAME_FOUND) {
+ if (rflags & CNAME_FOUND) {
if (RRsetPtr rrset = wild[RRType::CNAME()]) {
rrset->setName(task.qname);
m.addRRset(Section::ANSWER(), rrset);
@@ -355,7 +359,7 @@
QueryTask t(Name(*zone), task.qclass,
QueryTask::REF_QUERY);
r = doQueryTask(ds, q, t, auth);
- if (r != SUCCESS) {
+ if (r != SUCCESS || t.flags != 0) {
m.setRcode(Rcode::SERVFAIL());
return;
}
@@ -378,7 +382,7 @@
// okay, but if we were doing an original query, return NXDOMAIN
// and the SOA.
if (task.state == QueryTask::GETANSWER) {
- if (result == NAME_NOT_FOUND) {
+ if (task.flags & NAME_NOT_FOUND) {
m.setRcode(Rcode::NXDOMAIN());
}
@@ -386,7 +390,7 @@
QueryTask t(Name(*zone), task.qclass, RRType::SOA(),
QueryTask::SIMPLE_QUERY);
result = doQueryTask(ds, q, t, soa);
- if (result != SUCCESS) {
+ if (result != SUCCESS || t.flags != 0) {
m.setRcode(Rcode::SERVFAIL());
return;
}
@@ -396,20 +400,8 @@
return;
}
continue;
-
- case ZONE_NOT_FOUND:
- // No such zone. If we're chasing cnames or adding additional
- // data, that's okay, but if doing an original query, return
- // REFUSED.
- if (task.state == QueryTask::GETANSWER) {
- m.setRcode(Rcode::REFUSED());
- q.setStatus(Query::FAILURE);
- return;
- }
- continue;
-
- case NOT_IMPLEMENTED:
- case ERROR:
+ } else {
+ // Should never be reached!
m.setRcode(Rcode::SERVFAIL());
q.setStatus(Query::FAILURE);
return;
Modified: branches/each-ds/src/lib/auth/cpp/data_source.h
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/data_source.h (original)
+++ branches/each-ds/src/lib/auth/cpp/data_source.h Wed Feb 17 23:16:54 2010
@@ -37,12 +37,22 @@
enum Result {
SUCCESS,
ERROR,
- NOT_IMPLEMENTED,
- CNAME_FOUND,
- REFERRAL_FOUND,
- ZONE_NOT_FOUND,
- NAME_NOT_FOUND,
- TYPE_NOT_FOUND
+ NOT_IMPLEMENTED
+ };
+
+ // These flags indicate conditions encountered while processing a query.
+ //
+ // REFERRAL: The node contains an NS record
+ // CNAME_FOUND: The node contains a CNAME record
+ // NAME_NOT_FOUND: The node does not exist in the data source.
+ // TYPE_NOT_FOUND: The node does not contain the requested RRType
+ // NO_SUCH_ZONE: The zone does not exist in this data source.
+ enum QueryResponseFlags {
+ REFERRAL = 0x01,
+ CNAME_FOUND = 0x02,
+ NAME_NOT_FOUND = 0x04,
+ TYPE_NOT_FOUND = 0x08,
+ NO_SUCH_ZONE = 0x10
};
virtual ~AbstractDataSrc() {};
@@ -71,14 +81,14 @@
const RRClass& qclass,
const RRType& qtype,
RRsetList& target,
- RRsetList& sigs) const = 0;
+ uint32_t& flags) const = 0;
virtual Result findExactRRset(const Query& q,
const Name& qname,
const RRClass& qclass,
const RRType& qtype,
RRsetList& target,
- RRsetList& sigs) const = 0;
+ uint32_t& flags) const = 0;
// These will have dumb implementations in the general DataSrc
// class, and SHOULD be overwritten by subclasses.
@@ -86,13 +96,13 @@
const Name& qname,
const RRClass& qclass,
RRsetList& target,
- RRsetList& sigs) const = 0;
+ uint32_t& flags) const = 0;
virtual Result findReferral(const Query& q,
const Name& qname,
const RRClass& qclass,
RRsetList& target,
- RRsetList& sigs) const = 0;
+ uint32_t& flags) const = 0;
};
// Base class for a DNS Data Source
@@ -117,80 +127,86 @@
const RRClass& qclass,
const RRType& qtype,
RRsetList& target,
- RRsetList& sigs) const = 0;
+ uint32_t& flags) const = 0;
virtual Result findExactRRset(const Query& q,
const Name& qname,
const RRClass& qclass,
const RRType& qtype,
RRsetList& target,
- RRsetList& sigs) const = 0;
+ uint32_t& flags) const = 0;
virtual Result findAddrs(const Query& q,
const Name& qname,
const RRClass& qclass,
RRsetList& target,
- RRsetList& sigs) const {
+ uint32_t& flags) const {
Result r;
bool a = false, aaaa = false;
- r = findExactRRset(q, qname, qclass, RRType::A(), target, sigs);
- if (r == SUCCESS) {
+
+ flags = 0;
+ r = findExactRRset(q, qname, qclass, RRType::A(), target, flags);
+ if (r == SUCCESS && flags == 0) {
a = true;
- } else if (r != TYPE_NOT_FOUND) {
- return (r);
- }
-
- r = findExactRRset(q, qname, qclass, RRType::AAAA(), target, sigs);
- if (r == SUCCESS) {
+ }
+
+ flags = 0;
+ r = findExactRRset(q, qname, qclass, RRType::AAAA(), target, flags);
+ if (r == SUCCESS && flags == 0) {
aaaa = true;
- } else if (r != TYPE_NOT_FOUND) {
- return (r);
- }
-
- if (a || aaaa) {
- return (SUCCESS);
+ }
+
+ if (!a && !aaaa) {
+ flags = TYPE_NOT_FOUND;
} else {
- return (TYPE_NOT_FOUND);
- }
+ flags = 0;
+ }
+
+ return (SUCCESS);
}
virtual Result findReferral(const Query& q,
const Name& qname,
const RRClass& qclass,
RRsetList& target,
- RRsetList& sigs) const {
+ uint32_t& flags) const {
Result r;
bool ns = false, ds = false, dname = false;
- r = findExactRRset(q, qname, qclass, RRType::NS(), target, sigs);
- if (r == SUCCESS) {
+ flags = 0;
+ r = findExactRRset(q, qname, qclass, RRType::NS(), target, flags);
+ if (r == SUCCESS && flags == 0) {
ns = true;
- } else if (r != TYPE_NOT_FOUND) {
- return (r);
+ } else if ((flags & (NO_SUCH_ZONE|NAME_NOT_FOUND))) {
+ return (SUCCESS);
}
// XXX: The following code requires new rdata type implementation.
#if 0
- r = findExactRRset(q, qname, qclass, RRType::DS(), target, sigs);
- if (r == SUCCESS) {
+ flags = 0;
+ r = findExactRRset(q, qname, qclass, RRType::DS(), target, flags);
+ if (r == SUCCESS && flags == 0) {
ds = true;
- } else if (r != TYPE_NOT_FOUND) {
- return (r);
+ } else if ((flags & (NO_SUCH_ZONE|NAME_NOT_FOUND))) {
+ return (SUCCESS);
}
#endif
- r = findExactRRset(q, qname, qclass, RRType::DNAME(), target, sigs);
- if (r == SUCCESS) {
+ flags = 0;
+ r = findExactRRset(q, qname, qclass, RRType::DNAME(), target, flags);
+ if (r == SUCCESS && flags == 0) {
dname = true;
- } else if (r != TYPE_NOT_FOUND) {
- return (r);
- }
-
- if (ns || dname || ds) {
+ } else if ((flags & (NO_SUCH_ZONE|NAME_NOT_FOUND))) {
return (SUCCESS);
+ }
+
+ if (!ns && !dname && !ds) {
+ flags = TYPE_NOT_FOUND;
} else {
- return (TYPE_NOT_FOUND);
- }
+ flags = 0;
+ }
+
+ return (SUCCESS);
}
private:
@@ -230,25 +246,25 @@
Result findRRset(const Query& q, const Name& qname,
const RRClass& qclass, const RRType& qtype,
- RRsetList& target, RRsetList& sigs) const {
+ RRsetList& target, uint32_t& flags) const {
return (NOT_IMPLEMENTED);
}
Result findExactRRset(const Query& q, const Name& qname,
const RRClass& qclass, const RRType& qtype,
- RRsetList& target, RRsetList& sigs) const {
+ RRsetList& target, uint32_t& flags) const {
return (NOT_IMPLEMENTED);
}
Result findAddrs(const Query& q,
const Name& qname, const RRClass& qclass,
- RRsetList& target, RRsetList& sigs) const {
+ RRsetList& target, uint32_t& flags) const {
return (NOT_IMPLEMENTED);
}
Result findReferral(const Query& q,
const Name& qname, const RRClass& qclass,
- RRsetList& target, RRsetList& sigs) const {
+ RRsetList& target, uint32_t& flags) const {
return (NOT_IMPLEMENTED);
}
Modified: branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.cc
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.cc (original)
+++ branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.cc Wed Feb 17 23:16:54 2010
@@ -70,7 +70,7 @@
int
Sqlite3DataSrc::
findRecords(const Name& name, const RRType& rdtype, RRsetList& target,
- bool& node_exists, bool& found_cname, bool& found_ns) const
+ uint32_t& flags) const
{
int rc;
const string s_name = name.toText();
@@ -78,8 +78,11 @@
const string s_rdtype = rdtype.toText();
const char *c_rdtype = s_rdtype.c_str();
+ flags = 0;
+
int zone_id = findClosest(c_name, NULL);
if (zone_id < 0) {
+ flags = NO_SUCH_ZONE;
return (0);
}
@@ -103,8 +106,6 @@
int target_ttl = -1;
int sig_ttl = -1;
int rows = 0;
- found_cname = false;
- found_ns = false;
RRsetPtr rrset;
rc = sqlite3_step(q_record);
@@ -120,7 +121,7 @@
if (strcmp(c_rdtype, "NS") != 0 &&
(strcmp(type, "NS") == 0 ||
(sigtype != NULL && strcmp(sigtype, "NS") == 0))) {
- found_ns = true;
+ flags |= REFERRAL;
rc = sqlite3_step(q_record);
continue;
}
@@ -129,14 +130,18 @@
// looking for something else but found a CNAME
if (strcmp(type, "CNAME") == 0 && strcmp(c_rdtype, "CNAME") != 0) {
- found_cname = true;
+ flags |= CNAME_FOUND;
}
// first time through the loop, initialize RRset
if (rows == 1) {
- rrset = RRsetPtr(new RRset(name, RRClass::IN(),
- found_cname ? RRType::CNAME() : rdtype,
- RRTTL(3600)));
+ if (flags & CNAME_FOUND) {
+ rrset = RRsetPtr(new RRset(name, RRClass::IN(), RRType::CNAME(),
+ RRTTL(3600)));
+ } else {
+ rrset = RRsetPtr(new RRset(name, RRClass::IN(), rdtype,
+ RRTTL(3600)));
+ }
}
if (sigtype == NULL) {
@@ -169,7 +174,6 @@
if (rows > 0) {
rrset->setTTL(RRTTL(target_ttl));
target.addRRset(rrset);
- node_exists = true;
return (rows);
}
@@ -178,7 +182,6 @@
// any RRs with that name to determine whether this is NXDOMAIN or
// NXRRSET
//
- node_exists = false;
sqlite3_reset(q_count);
sqlite3_clear_bindings(q_count);
@@ -196,9 +199,12 @@
if(rc == SQLITE_ROW) {
int count = sqlite3_column_int(q_count, 0);
if (count != 0) {
- node_exists = true;
- }
- }
+ flags |= TYPE_NOT_FOUND;
+ return (0);
+ }
+ }
+
+ flags |= NAME_NOT_FOUND;
return (0);
}
@@ -368,23 +374,10 @@
const RRClass& qclass,
const RRType& qtype,
RRsetList& target,
- RRsetList& sigs) const
-{
- bool node_exists, found_cname, found_ns;
- int rows = findRecords(qname, qtype, target, node_exists,
- found_cname, found_ns);
-
- if (found_ns) {
- return (REFERRAL_FOUND);
- } else if (rows == 0 && node_exists) {
- return (TYPE_NOT_FOUND);
- } else if (rows == 0) {
- return (NAME_NOT_FOUND);
- } else if (found_cname) {
- return (CNAME_FOUND);
- } else {
- return (SUCCESS);
- }
+ uint32_t& flags) const
+{
+ findRecords(qname, qtype, target, flags);
+ return (SUCCESS);
}
DataSrc::Result
@@ -393,20 +386,20 @@
const RRClass& qclass,
const RRType& qtype,
RRsetList& target,
- RRsetList& sigs) const
-{
- bool node_exists, found_cname, found_ns;
- int rows = findRecords(qname, qtype, target, node_exists,
- found_cname, found_ns);
-
- // We ignore found_cname and found_ns in this version.
- if (found_cname || (rows == 0 && node_exists)) {
- return (TYPE_NOT_FOUND);
- } else if (rows == 0) {
- return (NAME_NOT_FOUND);
- } else {
- return (SUCCESS);
- }
+ uint32_t& flags) const
+{
+ findRecords(qname, qtype, target, flags);
+
+ // Ignore referrals in this case
+ flags &= ~REFERRAL;
+
+ // CNAMEs don't count in this case
+ if (flags & CNAME_FOUND) {
+ flags &= ~CNAME_FOUND;
+ flags |= TYPE_NOT_FOUND;
+ }
+
+ return (SUCCESS);
}
//
Modified: branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.h
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.h (original)
+++ branches/each-ds/src/lib/auth/cpp/data_source_sqlite3.h Wed Feb 17 23:16:54 2010
@@ -37,13 +37,15 @@
const Name& qname,
const RRClass& qclass,
const RRType& qtype,
- RRsetList& target, RRsetList& sigs) const;
+ RRsetList& target,
+ uint32_t& flags) const;
virtual Result findExactRRset(const Query& q,
const Name& qname,
const RRClass& qclass,
const RRType& qtype,
- RRsetList& target, RRsetList& sigs) const;
+ RRsetList& target,
+ uint32_t& flags) const;
virtual Result init();
virtual Result close();
@@ -55,7 +57,7 @@
int getVersion(void);
int hasExactZone(const char *name) const;
int findRecords(const Name& name, const RRType& rdtype, RRsetList& target,
- bool& node_exists, bool& found_cname, bool& found_ns) const;
+ uint32_t& flags) const;
int findClosest(const char *name, const char **position) const;
void loadVersion(void);
void setupPreparedStatements(void);
Modified: branches/each-ds/src/lib/auth/cpp/data_source_static.cc
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/data_source_static.cc (original)
+++ branches/each-ds/src/lib/auth/cpp/data_source_static.cc Wed Feb 17 23:16:54 2010
@@ -74,8 +74,9 @@
const RRClass& qclass,
const RRType& qtype,
RRsetList& target,
- RRsetList& sigs) const
+ uint32_t& flags) const
{
+ flags = 0;
if (qname == version_name &&
qclass == version->getClass() && qtype == version->getType()) {
target.addRRset(version);
@@ -96,9 +97,8 @@
return (SUCCESS);
}
- // XXX: this is not 100% correct.
- // We should also support the nodata/noerror case.
- return (NAME_NOT_FOUND);
+ flags = NAME_NOT_FOUND;
+ return (ERROR);
}
}
Modified: branches/each-ds/src/lib/auth/cpp/data_source_static.h
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/data_source_static.h (original)
+++ branches/each-ds/src/lib/auth/cpp/data_source_static.h Wed Feb 17 23:16:54 2010
@@ -44,16 +44,16 @@
const RRClass& qclass,
const RRType& qtype,
RRsetList& target,
- RRsetList& sigs) const;
+ uint32_t& flags) const;
Result findExactRRset(const Query& q,
const Name& qname,
const RRClass& qclass,
const RRType& qtype,
RRsetList& target,
- RRsetList& sigs) const
+ uint32_t& flags) const
{
- return (findRRset(q, qname, qclass, qtype, target, sigs));
+ return (findRRset(q, qname, qclass, qtype, target, flags));
}
Result init() { return (SUCCESS); }
Modified: branches/each-ds/src/lib/auth/cpp/query.cc
==============================================================================
--- branches/each-ds/src/lib/auth/cpp/query.cc (original)
+++ branches/each-ds/src/lib/auth/cpp/query.cc Wed Feb 17 23:16:54 2010
@@ -26,5 +26,8 @@
namespace isc {
namespace auth {
+// Destructor defined here to avoid confusing the linker
+QueryTask::~QueryTask() {}
+
}
}
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 Wed Feb 17 23:16:54 2010
@@ -105,24 +105,28 @@
FOLLOWCNAME
} state;
+ // Response flags to indicate conditions encountered while
+ // processing this task.
+ uint32_t flags;
+
// Constructors
QueryTask(const Name& n, const RRClass& c,
const RRType& t, const Section& sect) :
qname(n), qclass(c), qtype(t),
- section(sect), op(AUTH_QUERY), state(GETANSWER) {}
+ section(sect), op(AUTH_QUERY), state(GETANSWER), flags(0) {}
QueryTask(const Name& n, const RRClass& c,
const RRType& t, const Section& sect, const Op o) :
qname(n), qclass(c), qtype(t),
- section(sect), op(o), state(GETANSWER) {}
+ section(sect), op(o), state(GETANSWER), flags(0) {}
QueryTask(const Name& n, const RRClass& c,
const RRType& t, const Section& sect, const State st) :
qname(n), qclass(c), qtype(t),
- section(sect), op(AUTH_QUERY), state(st) {}
+ section(sect), op(AUTH_QUERY), state(st), flags(0) {}
QueryTask(const Name& n, const RRClass& c,
const RRType& t, const Section& sect,
const Op o, const State st) :
qname(n), qclass(c), qtype(t),
- section(sect), op(o), state(st) {}
+ section(sect), op(o), state(st), flags(0) {}
// These are special constructors for particular query task types,
// to simplify the code.
@@ -130,7 +134,7 @@
// A simple query doesn't need to specify section or state.
QueryTask(const Name& n, const RRClass& c, const RRType& t, const Op o) :
qname(n), qclass(c), qtype(t), section(Section::ANSWER()),
- op(o), state(GETANSWER) {
+ op(o), state(GETANSWER), flags(0) {
if (op != SIMPLE_QUERY) {
throw "invalid constructor for this task operation";
}
@@ -138,7 +142,7 @@
// A referral query doesn't need to specify section, state, or type.
QueryTask(const Name& n, const RRClass& c, const Op o) :
qname(n), qclass(c), qtype(RRType::ANY()), section(Section::ANSWER()),
- op(o), state(GETANSWER) {
+ op(o), state(GETANSWER), flags(0) {
if (op != REF_QUERY) {
throw "invalid constructor for this task operation";
}
@@ -147,13 +151,13 @@
QueryTask(const Name& n, const RRClass& c,
const Section& sect, const Op o, const State st) :
qname(n), qclass(c), qtype(RRType::ANY()),
- section(sect), op(o), state(st) {
+ section(sect), op(o), state(st), flags(0) {
if (op != ADDR_QUERY) {
throw "invalid constructor for this task operation";
}
}
- virtual ~QueryTask() {}
+ virtual ~QueryTask();
};
typedef std::queue<QueryTask> QueryTaskQueue;
More information about the bind10-changes
mailing list