I'm still new to the whole twisted way of doing things, but it sounds very sensible. :) Could you suggest a class to start studying from ? /tax 2009/10/22 <exarkun@twistedmatrix.com>
On 07:00 pm, jesper@taxboel.dk wrote:
Hi Jean-Paul,
I guess my focus is right when it comes to redirecting clients.
Im hooking into
DNSDatagramProtocol.writeMessage(self, message, address):
And I guess thats OK?
Depends what "OK" is supposed to mean.
But when it comes to bogus domains, I guess i could use:
DNSServerFactory.gotResolverError(self, failure, protocol, message, address):
I don't know why you should have to do that.
My problem is now how I construct a redirect package and channel it back to the client.
Do you think that is a sensible approach? -and do you hava a pointer on how to find the associated client.
It would probably be a lot easier and more robust to implement a completely new custom resolver that *wraps* an existing resolver, rather than trying to extend an existing resolver via a subclass. This removes many irrelevant implementation details from consideration (such as writeMessage and gotResolverError) and gives you an obvious place to put your redirect logic - in an errback on the Deferred returned by one of the wrapped resolver's lookup/query methods.
Jean-Paul
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python