Update server.py

This commit is contained in:
Nova Cat 2025-02-05 13:37:17 -08:00
parent 698446c4c1
commit ae0230d939

View file

@ -245,8 +245,6 @@ def session(connection, client, ip, isssl=False):
ping_pending = False ping_pending = False
pendingSend = "" # Text that should be sent to the client pendingSend = "" # Text that should be sent to the client
IRCv3Features = [] # List of Acknowledged IRCv3 features. IRCv3Features = [] # List of Acknowledged IRCv3 features.
connection.setblocking(False)
connection.settimeout(5)
def tags(): # Get IRCv3 tags def tags(): # Get IRCv3 tags
tags = "" tags = ""
if "server-time" in IRCv3Features: if "server-time" in IRCv3Features:
@ -292,6 +290,8 @@ def session(connection, client, ip, isssl=False):
connection.sendall(bytes(f":{server} NOTICE * :*** Uhm, Couldn't find your ident: Unknown error.\r\n","UTF-8")) connection.sendall(bytes(f":{server} NOTICE * :*** Uhm, Couldn't find your ident: Unknown error.\r\n","UTF-8"))
while True: while True:
try: try:
connection.setblocking(False)
connection.settimeout(5)
data = connection.recv(2048) data = connection.recv(2048)
if not data: if not data:
cause = "Remote host closed the connection" cause = "Remote host closed the connection"