mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 21:27:38 +03:00
Clean up session when s2s connections are disconnected
This commit is contained in:
parent
f9d8f8970f
commit
c91a86c73a
1 changed files with 8 additions and 0 deletions
|
@ -5,6 +5,7 @@ local init_xmlhandlers = require "core.xmlhandlers"
|
|||
local sm_new_session = require "core.sessionmanager".new_session;
|
||||
local s2s_new_incoming = require "core.s2smanager".new_incoming;
|
||||
local s2s_streamopened = require "core.s2smanager".streamopened;
|
||||
local s2s_destroy_session = require "core.s2smanager".destroy_session;
|
||||
|
||||
local connlisteners_register = require "net.connlisteners".register;
|
||||
|
||||
|
@ -70,6 +71,13 @@ function xmppserver.listener(conn, data)
|
|||
end
|
||||
|
||||
function xmppserver.disconnect(conn)
|
||||
local session = sessions[conn];
|
||||
if session then
|
||||
s2s_destroy_session(session);
|
||||
sessions[conn] = nil;
|
||||
session = nil;
|
||||
collectgarbage("collect");
|
||||
end
|
||||
end
|
||||
|
||||
function xmppserver.register_outgoing(conn, session)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue