Commit 35e1483e authored by Alexandre's avatar Alexandre
Browse files

Harmonize Request var names between DoH and DoT

parent 2a50125d
......@@ -204,27 +204,27 @@ class RequestDoH(Request):
else:
if not self.head:
try:
self.response = dns.message.from_wire(self.body)
self.response = dns.message.from_wire(self.response)
except dns.message.TrailingJunk: # Not DNS. Should
# not happen for a content type
# application/dns-message but who knows?
self.response = "ERROR Not proper DNS data, trailing junk \"%s\"" % self.body
self.response = "ERROR Not proper DNS data, trailing junk \"%s\"" % self.response
ok = False
except dns.name.BadLabelType: # Not DNS.
self.response = "ERROR Not proper DNS data (wrong path in the URL?) \"%s\"" % self.body[:100]
self.response = "ERROR Not proper DNS data (wrong path in the URL?) \"%s\"" % self.response[:100]
ok = False
else:
if self.body_size == 0:
if self.response_size == 0:
self.response = "HEAD successful"
else:
self.response = "ERROR Body length is not null \"%s\"" % self.body[:100]
self.response = "ERROR Body length is not null \"%s\"" % self.response[:100]
ok = False
else:
ok = False
if self.body_size == 0:
if self.response_size == 0:
self.response = "[No details]"
else:
self.response = self.body
self.response = self.response
return ok
......@@ -465,8 +465,8 @@ class ConnectionDoH(Connection):
body_size = len(body)
http_code = self.curl.getinfo(pycurl.RESPONSE_CODE)
content_type = self.curl.getinfo(pycurl.CONTENT_TYPE)
request.body = body
request.body_size = body_size
request.response = body
request.response_size = body_size
request.rcode = http_code
request.ctype = content_type
self.buffer.close()
......@@ -483,7 +483,7 @@ class ConnectionDoH(Connection):
request.post = post
self.send_and_receive(request)
request.check_response()
return (request.rcode, request.response, request.body_size)
return (request.rcode, request.response, request.response_size)
def get_next_domain(input_file):
......
Supports Markdown
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