aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-01-19 21:38:14 +0100
committerKim Alvefur <zash@zash.se>2023-01-19 21:38:14 +0100
commitb89b219406f266401c975c4745617ac35a0a9499 (patch)
tree84d66f831d9f30ef47fe97560887fdcce4aa7f9e
parent435e008568a0590f89e3b6477b9d6ded3ac024b4 (diff)
downloadprosody-b89b219406f266401c975c4745617ac35a0a9499.tar.gz
prosody-b89b219406f266401c975c4745617ac35a0a9499.zip
core.sessionmanager: Skip log when (not) destroying destroyed sessions
On regular disconnects, </stream> 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.
-rw-r--r--core/sessionmanager.lua3
1 files changed, 1 insertions, 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];