Skip to content

Commit a434eef

Browse files
author
clowwindy
committed
fix json decode issue
1 parent 3c11549 commit a434eef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shadowsocks/manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _parse_command(self, data):
140140
return data, None
141141
command, config_json = parts
142142
try:
143-
config = json.loads(config_json)
143+
config = shell.parse_json_in_str(config_json)
144144
return command, config
145145
except Exception as e:
146146
logging.error(e)
@@ -231,7 +231,7 @@ def run_server():
231231

232232
# test add and remove
233233
time.sleep(1)
234-
cli.send(b'add: {"server_port":7001, "password":"1234"}')
234+
cli.send(b'add: {"server_port":7001, "password":"asdfadsfasdf"}')
235235
time.sleep(1)
236236
assert 7001 in manager._relays
237237
data, addr = cli.recvfrom(1506)
@@ -246,7 +246,7 @@ def run_server():
246246

247247
# test statistics for TCP
248248
header = common.pack_addr(b'google.com') + struct.pack('>H', 80)
249-
data = encrypt.encrypt_all(b'1234', 'aes-256-cfb', 1,
249+
data = encrypt.encrypt_all(b'asdfadsfasdf', 'aes-256-cfb', 1,
250250
header + b'GET /\r\n\r\n')
251251
tcp_cli = socket.socket()
252252
tcp_cli.connect(('127.0.0.1', 7001))

0 commit comments

Comments
 (0)