BIND 10 #327: early work on recursion
BIND 10 Development
do-not-reply at isc.org
Thu Sep 16 00:07:42 UTC 2010
#327: early work on recursion
---------------------------+------------------------------------------------
Reporter: each | Owner: each
Type: defect | Status: new
Priority: major | Milestone: y2 12 month milestone
Component: recurser | Resolution:
Keywords: | Sensitive: 0
Estimatedhours: 0.0 | Hours: 0
Billable: 1 | Totalhours: 0
Internal: 0 |
---------------------------+------------------------------------------------
Comment(by each):
One of the first things that will need to be done to implement a resolver
(or any other server type other than authoritative) is to split off the
asio_link module from !AuthSrv.
In current code, the asio_link object is constructed with a pointer to the
auth server object; when packets are received, it calls
auth_srv->processMessage() and auth_srv->configSession(). I've replaced
that approach with one in which the caller provides asio_link with a pair
of callback objects, which do the same thing but can be provided by any
server class (!AuthSrv, Resolver, Forwarder, or whatever.)
While I was at it, in hopes of making it less painful to write the ASIO
handlers for the more complicated state machine we'll need to have when we
implement a full validating resolver, I changed the TCPServer and
UDPServer classes to use the "stackless coroutine" pattern described at:
http://blog.think-async.com/2010/03/potted-guide-to-stackless-
coroutines.html
The resulting code should be functionally identical to the previous code,
but it is shorter and (IMHO) easier to read: instead of several different
asynchronous response handlers, there's a single function for TCP and
another for UDP, and the I/O operations are all laid out in logical order.
The next step will be to move asio_link out of bin/auth and into src/lib
somewhere, but I'm leaving it where it is for now to make it easier to
read the diff.
I'd very much appreciate another pair of eyes looking at what I've done so
far...
--
Ticket URL: <http://bind10.isc.org/ticket/327#comment:1>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list