From 33c20d9cf432a5c4c2d380ce22e728344c259983 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 7 May 2023 12:27:55 +0200 Subject: core.sessionmanager: Delay closing a replaced connection after replacement Closing the session invokes ondisconnect and session close logic, including mod_smacks hibernation and the timer that destroys the session after a timeout. By closing the connection after it has been detached from the sessions table it will no longer invoke the ondetach handler, which should prevent the above problem. --- core/sessionmanager.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core') diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index ab06e6c0..750007fb 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -100,8 +100,7 @@ local function update_session(to_session, from_session) local replaced_conn = to_session.conn; if replaced_conn then - to_session.log("debug", "closing a replaced connection for this session"); - replaced_conn:close(); + to_session.conn = nil; end to_session.since = from_session.since; -- cgit v1.2.3