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.
--- 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];