From 50427c607594b3a2c12900e7a705e9f9b0762241 Mon Sep 17 00:00:00 2001 From: loggerhead Date: Mon, 10 Oct 2016 16:19:49 +0800 Subject: [PATCH] fix a OTA bug --- shadowsocks/tcprelay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index 2e4772d..f2cfd58 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -458,7 +458,7 @@ class TCPRelayHandler(object): return data_len = self._ota_buff_head[:ONETIMEAUTH_CHUNK_DATA_LEN] self._ota_len = struct.unpack('>H', data_len)[0] - length = min(self._ota_len, len(data)) + length = min(self._ota_len - len(self._ota_buff_data), len(data)) self._ota_buff_data += data[:length] data = data[length:] if len(self._ota_buff_data) == self._ota_len: