Changeset

12877:f6cca7cbf3b2 0.12

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.
author Kim Alvefur <zash@zash.se>
date Thu, 19 Jan 2023 21:38:14 +0100
parents 12863:891edd1ebde6
children 12878:0d8bf401fa73
files core/sessionmanager.lua
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/core/sessionmanager.lua	Sun Jan 22 14:45:47 2023 +0100
+++ b/core/sessionmanager.lua	Thu Jan 19 21:38:14 2023 +0100
@@ -93,12 +93,11 @@
 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];