From 5ed13ba891071ad04f58212a37cfbc8e176f83d2 Mon Sep 17 00:00:00 2001 From: swee Date: Mon, 9 Dec 2024 14:22:31 -0800 Subject: [PATCH] Update server.py --- server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 3769960..f9b3ddc 100644 --- a/server.py +++ b/server.py @@ -218,10 +218,11 @@ def session(connection, client): except Exception as ex: print(traceback.format_exc()) - cause = str(ex) + cause = "Read error: " + str(ex) break if not data: + cause = "Remote host closed the connection" break finally: connection.close() @@ -234,7 +235,7 @@ def session(connection, client): if pending in users: for j in users: if j != pending and not j in done: - nickname_list[j].sendall(bytes(f":{pending}!~{username}@{hostname} QUIT :Read error: {cause}\r\n","UTF-8")) + nickname_list[j].sendall(bytes(f":{pending}!~{username}@{hostname} QUIT :{cause}\r\n","UTF-8")) done.append(j) # Remove the quitting user from the channel. try: