[svn] commit: r1103 - in /trunk/src/lib/auth/cpp: query.cc query.h

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Mar 4 00:03:36 UTC 2010


Author: jinmei
Date: Thu Mar  4 00:03:35 2010
New Revision: 1103

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

Modified:
    trunk/src/lib/auth/cpp/query.cc
    trunk/src/lib/auth/cpp/query.h

Modified: trunk/src/lib/auth/cpp/query.cc
==============================================================================
--- trunk/src/lib/auth/cpp/query.cc (original)
+++ trunk/src/lib/auth/cpp/query.cc Thu Mar  4 00:03:35 2010
@@ -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() {}

Modified: trunk/src/lib/auth/cpp/query.h
==============================================================================
--- trunk/src/lib/auth/cpp/query.h (original)
+++ trunk/src/lib/auth/cpp/query.h Thu Mar  4 00:03:35 2010
@@ -187,27 +187,7 @@
     };
 
     // 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();
 




More information about the bind10-changes mailing list