From d794d6e7645164ffbb4ef4a634506f55d456a688 Mon Sep 17 00:00:00 2001 From: Sunny Date: Fri, 16 Jan 2015 18:05:20 +0800 Subject: [PATCH] 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 --- shadowsocks/asyncdns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks/asyncdns.py b/shadowsocks/asyncdns.py index 18222a6..0721986 100644 --- a/shadowsocks/asyncdns.py +++ b/shadowsocks/asyncdns.py @@ -413,7 +413,7 @@ class DNSResolver(object): def _send_req(self, hostname, qtype): self._request_id += 1 - if self._request_id > 32768: + if self._request_id > 65536: self._request_id = 1 req = build_request(hostname, qtype, self._request_id) for server in self._servers: