Commit 1d560610 authored by Alexandre's avatar Alexandre

Missing import, uncaught exception

parent c3b88e1e
......@@ -10,6 +10,7 @@ import getopt
import urllib.parse
import time
import socket
import dns
try:
# http://pycurl.io/docs/latest
......@@ -309,6 +310,9 @@ def check_truncated_query(connection, opts, level=remoh.mandatory_levels["niceto
# the RCODE set to FORMERR
# so response can not be parsed in this case
return True
except remoh.ConnectionDOTException as e:
print(e, file=sys.stderr)
return connection.state == 'CONN_CLOSED'
except remoh.DOHException as e:
print(e, file=sys.stderr)
return False
......
......@@ -57,12 +57,12 @@ class RequestDOT(Request):
def store_response(self, rcode, data, size):
self.rcode = True
self.response_size = size
try:
self.response = dns.message.from_wire(data)
except dns.exception.FormError as e:
self.response = "ERROR %s" % e
self.rcode = False
self.response_size = size
class RequestDOH(Request):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment