plugins/mod_c2s.lua
changeset 13388 57ad1dfd8e8b
parent 13293 38c95544b7ee
child 13424 7dc7e2e15b2a
--- a/plugins/mod_c2s.lua	Sun Dec 03 15:44:15 2023 +0100
+++ b/plugins/mod_c2s.lua	Sun Dec 03 15:46:33 2023 +0100
@@ -369,10 +369,12 @@
 	end
 
 	if c2s_timeout < math.huge then
-		add_task(c2s_timeout, function ()
+		session.c2s_timeout = add_task(c2s_timeout, function ()
 			if session.type == "c2s_unauthed" then
 				(session.log or log)("debug", "Connection still not authenticated after c2s_timeout=%gs, closing it", c2s_timeout);
 				session:close("connection-timeout");
+			else
+				session.c2s_timeout = nil;
 			end
 		end);
 	end