From e72594ffbe92b80ddb1770268ca3effb3b64a0ee Mon Sep 17 00:00:00 2001 From: clowwindy Date: Sun, 14 Sep 2014 10:16:40 +0800 Subject: [PATCH] only end querying when response is of query type AAAA --- shadowsocks/asyncdns.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shadowsocks/asyncdns.py b/shadowsocks/asyncdns.py index a103f8c..55fbb11 100644 --- a/shadowsocks/asyncdns.py +++ b/shadowsocks/asyncdns.py @@ -363,7 +363,10 @@ class DNSResolver(object): self._cache[hostname] = ip self._call_callback(hostname, ip) elif self._hostname_status.get(hostname, None) == STATUS_IPV6: - self._call_callback(hostname, None) + for question in response.questions: + if question[1] == QTYPE_AAAA: + self._call_callback(hostname, None) + break def handle_events(self, events): for sock, fd, event in events: