|
|
@ -388,15 +388,15 @@ class UDPRelay(object): |
|
|
|
handler = common.UDPAsyncDNSHandler((data, r_addr, uid, header_length)) |
|
|
|
handler.resolve(self._dns_resolver, (server_addr, server_port), self._handle_server_dns_resolved) |
|
|
|
else: |
|
|
|
self._handle_server_dns_resolved((server_addr, server_port), None, server_addr, False, data, r_addr, uid, header_length) |
|
|
|
self._handle_server_dns_resolved((server_addr, server_port), server_addr, (data, r_addr, uid, header_length)) |
|
|
|
else: |
|
|
|
self._handle_server_dns_resolved((server_addr, server_port), None, server_addr, False, data, r_addr, uid, header_length) |
|
|
|
self._handle_server_dns_resolved((server_addr, server_port), server_addr, (data, r_addr, uid, header_length)) |
|
|
|
|
|
|
|
def _handle_server_dns_resolved(self, remote_addr, addrs, server_addr, dns_resolved, data, r_addr, uid, header_length): |
|
|
|
def _handle_server_dns_resolved(self, remote_addr, server_addr, params): |
|
|
|
data, r_addr, uid, header_length = params |
|
|
|
user_id = self._listen_port |
|
|
|
try: |
|
|
|
server_port = remote_addr[1] |
|
|
|
if addrs is None: |
|
|
|
addrs = socket.getaddrinfo(server_addr, server_port, 0, |
|
|
|
socket.SOCK_DGRAM, socket.SOL_UDP) |
|
|
|
if not addrs: # drop |
|
|
|