summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-14 08:56:30 +0300
committerDevaev Maxim <[email protected]>2018-07-14 08:56:30 +0300
commit4122ecdb55abae00f2168d27df5f88527fc02341 (patch)
tree016ca56f636637808da1fb4ff1332c26cfae43c4
parent46e2125de24dade2610c6ba3f8b9251139ca3f1f (diff)
kvmd: fixed pong, removed echo
-rw-r--r--kvmd/kvmd/server.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/kvmd/kvmd/server.py b/kvmd/kvmd/server.py
index fb46ea82..ae5ec14d 100644
--- a/kvmd/kvmd/server.py
+++ b/kvmd/kvmd/server.py
@@ -151,18 +151,16 @@ class Server: # pylint: disable=too-many-instance-attributes
logger.error("Can't parse JSON event from websocket: %s", err)
else:
if event.get("event_type") == "ping":
- ws.send_str(json.dumps({"msg_type": "pong"}))
+ await ws.send_str(json.dumps({"msg_type": "pong"}))
elif event.get("event_type") == "key":
key = str(event.get("key", ""))[:64].strip()
state = event.get("state")
if key and state in [True, False]:
await self.__hid.send_key_event(key, state)
- continue
elif event.get("event_type") in ["mouse_move", "mouse_button", "mouse_wheel"]:
pass
else:
logger.error("Invalid websocket event: %r", event)
- await ws.send_str(json.dumps({"msg_type": "echo", "msg": msg.data}))
else:
break
return ws