From 30f923aac87b996cf5985e4b24c935306781732f Mon Sep 17 00:00:00 2001 From: swee Date: Wed, 29 Jan 2025 19:59:46 -0800 Subject: [PATCH] Update server.py --- server.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/server.py b/server.py index 33e1d8e..fd60043 100644 --- a/server.py +++ b/server.py @@ -709,16 +709,15 @@ def session(connection, client, ip, isssl=False): connection.sendall(bytes(f":{server} 401 {pending} {target} :No such nick/channel\r\n","UTF-8")) else: connection.sendall(bytes(f":{server} 461 {pending} {command} :Not enough parameters\r\n","UTF-8")) + # Ignore empty text + elif text.split(" ")[0] == "": + pass + else: + # Unknown command + cmd = text.split(" ")[0] + connection.sendall(bytes(f":{server} 421 {pending} {cmd} :Unknown command\r\n","UTF-8")) else: pendingCommands.append(text) - - # Ignore empty text - elif text.split(" ")[0] == "": - pass - else: - # Unknown command - cmd = text.split(" ")[0] - connection.sendall(bytes(f":{server} 421 {pending} {cmd} :Unknown command\r\n","UTF-8")) except ssl.SSLEOFError: print("EOF occured...") except Exception as ex: