Commit 840c1d8b authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

relatively minor cleanup: move a big constructor logic to .cc


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1103 e5f2f494-b856-4b98-b285-d166d9295462
parent 954a0b8f
......@@ -26,6 +26,25 @@
namespace isc {
namespace auth {
Query::Query(Message& m, bool dnssec) :
status_(PENDING), qname_(NULL), qclass_(NULL), qtype_(NULL),
message_(&m), want_additional_(true), want_dnssec_(dnssec)
{
// Check message formatting
if (message_->getRRCount(Section::QUESTION()) != 1) {
dns_throw(Unexpected, "malformed message: too many questions");
}
// Populate the query task queue with the initial question
QuestionPtr question = *message_->beginQuestion();
qname_ = &question->getName();
qclass_ = &question->getClass();
qtype_ = &question->getType();
querytasks_.push(QueryTaskPtr(new QueryTask(*qname_, *qclass_, *qtype_,
Section::ANSWER())));
}
// Destructors defined here to avoid confusing the linker
QueryTask::~QueryTask() {}
Query::~Query() {}
......
......@@ -187,27 +187,7 @@ public:
};
// Query constructor
Query(Message& m, bool dnssec) {
message_ = &m;
want_additional_ = true;
want_dnssec_ = dnssec;
status_ = PENDING;
// Check message formatting
if (message_->getRRCount(Section::QUESTION()) != 1) {
dns_throw(Unexpected, "malformed message: too many questions");
}
// Populate the query task queue with the initial question
QuestionPtr query = *message_->beginQuestion();
qname_ = &query->getName();
qclass_ = &query->getClass();
qtype_ = &query->getType();
QueryTaskPtr initial_task(new QueryTask(*qname_, *qclass_, *qtype_,
Section::ANSWER()));
querytasks_.push(initial_task);
};
Query(Message& m, bool dnssec);
virtual ~Query();
......
Supports Markdown
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