MCPcopy Create free account
hub / github.com/rthalley/dnspython / handle

Method handle

tests/nanonameserver.py:239–254  ·  view source on GitHub ↗
(self, request)

Source from the content-addressed store, hash-verified

237 raise EOFError
238
239 def handle(self, request):
240 #
241 # Handle request 'request'. Override this method to change
242 # how the server behaves.
243 #
244 # The return value is either a dns.message.Message, a bytes,
245 # None, or a list of one of those. We allow a bytes to be
246 # returned for cases where handle wants to return an invalid
247 # DNS message for testing purposes. We allow None to be
248 # returned to indicate there is no response. If a list is
249 # returned, then the output code will run for each returned
250 # item.
251 #
252 r = dns.message.make_response(request.message)
253 r.set_rcode(dns.rcode.REFUSED)
254 return r
255
256 def maybe_listify(self, thing):
257 if isinstance(thing, list):

Callers 1

handle_wireMethod · 0.95

Calls 1

set_rcodeMethod · 0.80

Tested by

no test coverage detected