Skip to content

Commit

Permalink
refine dns_resolve_over_tcp
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu committed May 4, 2014
1 parent ba40039 commit 326b4f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions local/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2070,10 +2070,10 @@ def filter(self, handler):
elif hostname == host and host.endswith(common.DNS_TCPOVER) and host not in handler.dns_cache:
try:
iplist = dns_resolve_over_tcp(host, handler.dns_servers, handler.dns_blacklist, 4)
logging.info('TcpoverDnsFilter resolve %r with %r return %s', host, handler.dns_servers, iplist)
logging.info('HostsFilter dns_resolve_over_tcp %r with %r return %s', host, handler.dns_servers, iplist)
handler.dns_cache[host] = iplist
except socket.error as e:
logging.warning('TcpoverDnsFilter resolve %r with %r failed: %r', host, handler.dns_servers, e)
logging.warning('HostsFilter dns_resolve_over_tcp %r with %r failed: %r', host, handler.dns_servers, e)
elif re.match(r'^\d+\.\d+\.\d+\.\d+$', hostname) or ':' in hostname:
handler.dns_cache[host] = [hostname]
elif hostname.startswith('file://'):
Expand Down

0 comments on commit 326b4f7

Please sign in to comment.