# HG changeset patch # User Kim Alvefur # Date 1701614793 -3600 # Node ID 57ad1dfd8e8b8f7362f49474002f2d36c4b96053 # Parent 091667bd2f0e0e523f0c33ce2d4a6a88a30fd40c mod_c2s: Make c2s_timeout timer reachable to allow access from other modules E.g. the timeout could be extended under certain conditions. diff -r 091667bd2f0e -r 57ad1dfd8e8b plugins/mod_c2s.lua --- 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