| 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): |