aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-12-03 15:46:33 +0100
committerKim Alvefur <zash@zash.se>2023-12-03 15:46:33 +0100
commit5dfd9d25cd8ac0ef03c7bae601da605ea33e9feb (patch)
treef63fa50510200345284d8403f40786bea67738f2 /plugins
parent75335ede7306fc5a462fc3f891567e59d3f0d891 (diff)
downloadprosody-5dfd9d25cd8ac0ef03c7bae601da605ea33e9feb.tar.gz
prosody-5dfd9d25cd8ac0ef03c7bae601da605ea33e9feb.zip
mod_c2s: Make c2s_timeout timer reachable to allow access from other modules
E.g. the timeout could be extended under certain conditions.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_c2s.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index 6587aa68..4dabf34b 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -369,10 +369,12 @@ function listener.onconnect(conn)
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