fix udprelay for local

This commit is contained in:
clowwindy 2014-07-11 18:00:58 +08:00
parent 68cf94b10e
commit 122f233143
1 changed files with 4 additions and 3 deletions

View File

@ -176,13 +176,14 @@ class UDPRelay(object):
self._sockets.add(client.fileno())
self._eventloop.add(client, eventloop.POLL_IN)
data = data[header_length:]
if not data:
return
if self._is_local:
data = encrypt.encrypt_all(self._password, self._method, 1, data)
if not data:
return
else:
data = data[header_length:]
if not data:
return
try:
client.sendto(data, (server_addr, server_port))
except IOError as e: