From ae0230d939b6efa807373cd8c140b32c34873a96 Mon Sep 17 00:00:00 2001
From: swee <meow@swee.codes>
Date: Wed, 5 Feb 2025 13:37:17 -0800
Subject: [PATCH] Update server.py

---
 server.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server.py b/server.py
index 1731ab9..7eda5d7 100644
--- a/server.py
+++ b/server.py
@@ -245,8 +245,6 @@ def session(connection, client, ip, isssl=False):
     ping_pending = False
     pendingSend = "" # Text that should be sent to the client
     IRCv3Features = [] # List of Acknowledged IRCv3 features.
-    connection.setblocking(False)
-    connection.settimeout(5)
     def tags(): # Get IRCv3 tags
         tags = ""
         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"))
         while True:
             try:
+                connection.setblocking(False)
+                connection.settimeout(5)
                 data = connection.recv(2048)
                 if not data:
                     cause = "Remote host closed the connection"