mod_console: s2s:close: Use session:close() if that exists, otherwise just destroy the session

Thu, 24 Sep 2009 23:44:13 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 24 Sep 2009 23:44:13 +0100
changeset 1821
05ed826da89b
parent 1820
3e0e9f80010a
child 1822
2f78ea5d0f11

mod_console: s2s:close: Use session:close() if that exists, otherwise just destroy the session

plugins/mod_console.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_console.lua	Thu Sep 24 23:25:18 2009 +0100
+++ b/plugins/mod_console.lua	Thu Sep 24 23:44:13 2009 +0100
@@ -496,7 +496,7 @@
 		if not session then 
 			print("No outgoing connection from "..from.." to "..to)
 		else
-			s2smanager.destroy_session(session);
+			(session.close or s2smanager.destroy_session)(session);
 			count = count + 1;
 			print("Closed outgoing session from "..from.." to "..to);
 		end
@@ -504,7 +504,7 @@
 		-- Is an incoming connection
 		for session in pairs(incoming_s2s) do
 			if session.to_host == to and session.from_host == from then
-				s2smanager.destroy_session(session);
+				(session.close or s2smanager.destroy_session)(session);
 				count = count + 1;
 			end
 		end

mercurial