[svn] commit: r840 - in /branches/each-ds/src/lib/auth/cpp: TODO query.h

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Feb 16 16:34:24 UTC 2010


Author: each
Date: Tue Feb 16 16:34:24 2010
New Revision: 840

Log:
use getRRCount() to verify query has exactly 1 question

Modified:
    branches/each-ds/src/lib/auth/cpp/TODO
    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 Tue Feb 16 16:34:24 2010
@@ -25,7 +25,5 @@
 - findRecords() should handle the Name-to-c_str conversion, not the caller
 
 Other changes:
-- add Message method getSectionCount() so it isn't necessary to iterate
-  over the question section to find out how many there are.
 - add Name method reverse() to reverse labels (might return a Name, or
   maybe just a string).

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 Tue Feb 16 16:34:24 2010
@@ -180,10 +180,9 @@
         // Check message formatting
         // (XXX: The Message API should have a method for getting
         // section counts without having to use an iterator)
-        QuestionIterator qid = message_->beginQuestion();
-        qid++;
-        if (qid != message_->endQuestion())
-                dns_throw(Unexpected, "malformed message: too many questions");
+        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();




More information about the bind10-changes mailing list