mod_c2s: Make c2s_timeout timer reachable to allow access from other modules

E.g. the timeout could be extended under certain conditions.
pull/27/head
Kim Alvefur 2 years ago
parent 75335ede73
commit 5dfd9d25cd
  1. 4
      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

Loading…
Cancel
Save