Skip to content

Commit

Permalink
fix json decode issue
Browse files Browse the repository at this point in the history
  • Loading branch information
clowwindy committed Aug 10, 2015
1 parent 3c11549 commit a434eef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shadowsocks/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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))
Expand Down

0 comments on commit a434eef

Please sign in to comment.