From a434eef096fe6cd339a205b85205b6ec8e443ad0 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Mon, 10 Aug 2015 11:53:54 +0800 Subject: [PATCH] fix json decode issue --- shadowsocks/manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shadowsocks/manager.py b/shadowsocks/manager.py index e125ef495..e8009b481 100644 --- a/shadowsocks/manager.py +++ b/shadowsocks/manager.py @@ -140,7 +140,7 @@ def _parse_command(self, data): return data, None command, config_json = parts try: - config = json.loads(config_json) + config = shell.parse_json_in_str(config_json) return command, config except Exception as e: logging.error(e) @@ -231,7 +231,7 @@ def run_server(): # test add and remove time.sleep(1) - cli.send(b'add: {"server_port":7001, "password":"1234"}') + cli.send(b'add: {"server_port":7001, "password":"asdfadsfasdf"}') time.sleep(1) assert 7001 in manager._relays data, addr = cli.recvfrom(1506) @@ -246,7 +246,7 @@ def run_server(): # test statistics for TCP header = common.pack_addr(b'google.com') + struct.pack('>H', 80) - data = encrypt.encrypt_all(b'1234', 'aes-256-cfb', 1, + data = encrypt.encrypt_all(b'asdfadsfasdf', 'aes-256-cfb', 1, header + b'GET /\r\n\r\n') tcp_cli = socket.socket() tcp_cli.connect(('127.0.0.1', 7001))