s2smanager: Log reason when destroying a session.
authorWaqas Hussain <waqas20@gmail.com>
Sat, 07 May 2011 21:15:13 +0500
changeset 4262 fd4d1cf6d63e
parent 4261 b980a4173c1a
child 4263 618e2a2b2d2c
s2smanager: Log reason when destroying a session.
core/s2smanager.lua
--- a/core/s2smanager.lua	Wed May 04 23:13:50 2011 +0100
+++ b/core/s2smanager.lua	Sat May 07 21:15:13 2011 +0500
@@ -625,7 +625,7 @@
 
 function destroy_session(session, reason)
 	if session.destroyed then return; end
-	(session.log or log)("debug", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host));
+	(session.log or log)("debug", "Destroying "..tostring(session.direction).." session "..tostring(session.from_host).."->"..tostring(session.to_host)..(reason and (": "..reason) or ""));
 	
 	if session.direction == "outgoing" then
 		hosts[session.from_host].s2sout[session.to_host] = nil;