From e5e08115529706bb11b6a244ff28340cc1ea8ba6 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 24 Oct 2008 18:14:40 +0100 Subject: other half of previous commit --- core/s2smanager.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 38919d81..ba14f2fe 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -179,4 +179,18 @@ function mark_connected(session) end end +function destroy_session(session) + (session.log or log)("info", "Destroying session"); + if session.direction == "outgoing" then + hosts[session.to_host] = nil; + end + session.conn = nil; + session.disconnect = nil; + for k in pairs(session) do + if k ~= "trace" then + session[k] = nil; + end + end +end + return _M; \ No newline at end of file -- cgit v1.2.3