diff options
-rw-r--r-- | core/s2smanager.lua | 14 |
1 files changed, 14 insertions, 0 deletions
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 |