From c1364c3afef69da369d3b9dcc1d5638f9ec18eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Sat, 27 May 2017 13:06:35 +0800 Subject: [PATCH] init user_id --- shadowsocks/udprelay.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shadowsocks/udprelay.py b/shadowsocks/udprelay.py index ece08a4..c69b6ed 100644 --- a/shadowsocks/udprelay.py +++ b/shadowsocks/udprelay.py @@ -412,6 +412,7 @@ class UDPRelay(object): self._handle_server_dns_resolved((server_addr, server_port), None, server_addr, False, 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): + user_id = self._listen_port try: server_port = remote_addr[1] if addrs is None: @@ -457,9 +458,7 @@ class UDPRelay(object): logging.debug('UDP port %5d sockets %d' % (self._listen_port, len(self._sockets))) - if uid is None: - user_id = self._listen_port - else: + if uid is not None: user_id = struct.unpack('