Change max request id to 2^16

According to RFC 1035
Request id is a 16 bit unsigned number, not a signed short
So change max request id to 65536
This commit is contained in:
Sunny 2015-01-16 18:05:20 +08:00
parent 13413267dc
commit d794d6e764

View file

@ -413,7 +413,7 @@ class DNSResolver(object):
def _send_req(self, hostname, qtype): def _send_req(self, hostname, qtype):
self._request_id += 1 self._request_id += 1
if self._request_id > 32768: if self._request_id > 65536:
self._request_id = 1 self._request_id = 1
req = build_request(hostname, qtype, self._request_id) req = build_request(hostname, qtype, self._request_id)
for server in self._servers: for server in self._servers: