From 4b9741256912f66997ac7c79c994e909529bf4e9 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Wed, 25 Nov 2015 16:58:30 +0800 Subject: [PATCH] only correct request add into transfer size --- shadowsocks/tcprelay.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index e9492f0..c24f2b6 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -276,7 +276,8 @@ class TCPRelayHandler(object): pass else: if sock == self._remote_sock: - self._server.server_transfer_ul += len(data) + if self._encrypt_correct: + self._server.server_transfer_ul += len(data) elif self._encrypt_correct and (self._obfs is not None): obfs_encode = self._obfs.server_encode(data) data = obfs_encode