From 4ebae2a9e5da9eeeb60f19e9325fdba89e564d18 Mon Sep 17 00:00:00 2001 From: swee Date: Mon, 9 Dec 2024 13:48:45 -0800 Subject: [PATCH] Update server.py --- server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 1f25386..fb8b040 100644 --- a/server.py +++ b/server.py @@ -191,8 +191,10 @@ def session(connection, client): except: print(traceback.format_exc()) # Confirm QUIT and close the socket. - connection.sendall(bytes(f":{pending}!~{username}@{hostname} {text}\r\n","UTF-8")) - connection.sendall(bytes(f"ERROR :Closing Link: {hostname} ({msg})\r\n","UTF-8")) + if connection.recv(2048): + connection.sendall(bytes(f":{pending}!~{username}@{hostname} {text}\r\n","UTF-8")) + if connection.recv(2048): + connection.sendall(bytes(f"ERROR :Closing Link: {hostname} ({msg})\r\n","UTF-8")) connection.close() safe_quit = True break