From c9e44686b3d06b047600e345e57f3e50e3042381 Mon Sep 17 00:00:00 2001 From: swee Date: Wed, 29 Jan 2025 20:12:13 -0800 Subject: [PATCH] Update server.py --- server.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server.py b/server.py index cf6021e..87f2cfe 100644 --- a/server.py +++ b/server.py @@ -230,7 +230,7 @@ def session(connection, client, ip, isssl=False): usesIRCv3 = False CAPEND = False clident = None - pendingCommands = [] # list of commands that were executed before verification + pendingCommands = "" # list of commands that were executed before verification try: print("Connected to client IP: {}".format(client)) connection.sendall(bytes(f":{server} NOTICE * :*** Looking for your hostname...\r\n","UTF-8")) @@ -368,8 +368,8 @@ def session(connection, client, ip, isssl=False): connection.sendall(bytes(f":{server} 372 {pending} :- {i}\r\n", "UTF-8")) connection.sendall(bytes(f":{server} 376 {pending} :End of /MOTD command\r\n", "UTF-8")) elif finished: - pendingCommands.append(text) - for comd in pendingCommands: + pendingCommands += text + for comd in pendingCommands.split("\r\n"): command = comd.split(" ")[0].upper() args = comd.split(" ")[1:] text = comd @@ -717,9 +717,9 @@ def session(connection, client, ip, isssl=False): # Unknown command cmd = text.split(" ")[0] connection.sendall(bytes(f":{server} 421 {pending} {cmd} :Unknown command\r\n","UTF-8")) - pendingCommands = [] + pendingCommands = "" else: - pendingCommands.append(text) + pendingCommands += text except ssl.SSLEOFError: print("EOF occured...") except Exception as ex: