BIND 10 #1747: refactor auth::Query so it's reusable
BIND 10 Development
do-not-reply at isc.org
Fri Mar 9 14:23:47 UTC 2012
#1747: refactor auth::Query so it's reusable
-------------------------------------+-------------------------------------
Reporter: | Owner: UnAssigned
jinmei | Status: reviewing
Type: task | Milestone:
Priority: high | Sprint-20120320
Component: | Resolution:
b10-auth | Sensitive: 0
Keywords: | Sub-Project: DNS
Defect Severity: N/A | Estimated Difficulty: 4
Feature Depending on Ticket: auth | Total Hours: 0
performance |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by jelte):
* owner: jelte => UnAssigned
* status: assigned => reviewing
Comment:
Ok ready for review,
I've moved the constructor arguments to process(), which uses a new
internal method initialize() to set the members, which are now non-const
and pointers instead of references (though the method arguments are still
refs so as not to risk nullpointers).
I moved the rrsetptr vectors out of process(), they are now members as
well, and split up target_ into answers_ and authorities_.
They are not put into the response until createResponse() is called (done
by process() before it returns).
Regarding these vectors; process() is not exception-safe (just like it was
not and is not safe because it modifies response); they can be modified.
However, these vectors are reset both in createResponse and before
process() starts to do any work, which i think for now is good enough.
I also added a lettuce test that does multiple queries, to make sure it
also works there.
Due to the changed API, the diff got quite big, esp. for the unit tests,
but most of these changes are straightforward.
There is also future refactoring work we could do; I think we could
probably get rid of the qname/qtype/datasrc/etc members altogether, and
only pass them along as references. We can also make process keep track of
everything, and not modify response until the very end. And there's
probably more :p
--
Ticket URL: <http://bind10.isc.org/ticket/1747#comment:5>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list