aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-24 18:13:54 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-24 18:13:54 +0100
commitc91a86c73a581733158cc09e8ba4583b079b10f2 (patch)
tree944d37b3adf70aabe827cc3fca57eb80e4990363
parentf9d8f8970fb8c9a2da897e2ac0033373bccd3bfd (diff)
downloadprosody-c91a86c73a581733158cc09e8ba4583b079b10f2.tar.gz
prosody-c91a86c73a581733158cc09e8ba4583b079b10f2.zip
Clean up session when s2s connections are disconnected
-rw-r--r--net/xmppserver_listener.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua
index 7c5b0d9c..111633d8 100644
--- a/net/xmppserver_listener.lua
+++ b/net/xmppserver_listener.lua
@@ -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)