Software /
code /
prosody
Diff
plugins/mod_c2s.lua @ 13384:57ad1dfd8e8b
mod_c2s: Make c2s_timeout timer reachable to allow access from other modules
E.g. the timeout could be extended under certain conditions.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 03 Dec 2023 15:46:33 +0100 |
parent | 13289:38c95544b7ee |
child | 13420:7dc7e2e15b2a |
line wrap: on
line diff
--- 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