Changeset

164:8dc1faa5b1df

other half of previous commit
author Matthew Wild <mwild1@gmail.com>
date Fri, 24 Oct 2008 18:14:40 +0100
parents 163:3fec9b512d4e
children 165:4adc53e03b4d
files core/s2smanager.lua
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Fri Oct 24 18:13:54 2008 +0100
+++ b/core/s2smanager.lua	Fri Oct 24 18:14:40 2008 +0100
@@ -179,4 +179,18 @@
 	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