other half of previous commit
authorMatthew Wild <mwild1@gmail.com>
Fri, 24 Oct 2008 17:14:40 +0000 (18:14 +0100)
committerMatthew Wild <mwild1@gmail.com>
Fri, 24 Oct 2008 17:14:40 +0000 (18:14 +0100)
core/s2smanager.lua

index 38919d8157c5be2c6c18a858963e47a2a8839d2e..ba14f2fe8addc938e638fd5a2bd11a465c5162f8 100644 (file)
@@ -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