timelord catch exception on decode

This commit is contained in:
Yostra 2020-04-01 17:56:34 -07:00
parent f5041ca770
commit 5f8e10691d

View File

@ -261,7 +261,14 @@ class Timelord:
self.done_discriminants.append(challenge_hash)
break
if data.decode() == "STOP":
msg = ""
try:
msg = data.decode()
except Exception as e:
log.error(f"Exception while decoding data {e}")
pass
if msg == "STOP":
log.info(f"Stopped client running on ip {ip}.")
async with self.lock:
writer.write(b"ACK")