From e1aa68029dd2e3eace5ac40d3b2853eafe22d4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=B4=E5=A8=83=E9=85=B1?= Date: Sat, 20 Aug 2016 23:12:34 +0800 Subject: [PATCH] log if no user --- db_transfer.py | 4 ++++ shadowsocks/tcprelay.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/db_transfer.py b/db_transfer.py index a9657b8..b85c66e 100644 --- a/db_transfer.py +++ b/db_transfer.py @@ -311,6 +311,8 @@ class DbTransfer(TransferBase): rows = self.pull_db_users(conn) conn.close() + if len(rows) == 0: + logging.warn('no user in db') return rows def pull_db_users(self, conn): @@ -517,5 +519,7 @@ class MuJsonTransfer(TransferBase): except Exception as e: logging.error(e) + if len(rows) == 0: + logging.warn('no user in json file') return rows diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index a6c981a..13e010a 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -114,7 +114,7 @@ class TCPRelayHandler(object): config['method']) except Exception: self._stage = STAGE_DESTROYED - logging.error('creater encryptor fail at port %d', server._listen_port) + logging.error('create encryptor fail at port %d', server._listen_port) return self._encrypt_correct = True self._obfs = obfs.obfs(config['obfs'])