From b89b219406f266401c975c4745617ac35a0a9499 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 19 Jan 2023 21:38:14 +0100 Subject: core.sessionmanager: Skip log when (not) destroying destroyed sessions On regular disconnects, is sent, then sessionmanager.destroy_session() is called, then sessionmanager.destroy_session() is called again when the TCP connection is closed, from ondisconnect in mod_c2s. It is a bit annoying and doesn't really tell you much. --- core/sessionmanager.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index 7f296ff1..60135e1f 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -93,12 +93,11 @@ local function retire_session(session) end local function destroy_session(session, err) + if session.destroyed then return; end (session.log or log)("debug", "Destroying session for %s (%s@%s)%s", session.full_jid or "(unknown)", session.username or "(unknown)", session.host or "(unknown)", err and (": "..err) or ""); - if session.destroyed then return; end - -- Remove session/resource from user's session list if session.full_jid then local host_session = hosts[session.host]; -- cgit v1.2.3