s2smanager: Log reason when destroying a session.
authorWaqas Hussain <waqas20@gmail.com>
Sat, 7 May 2011 16:15:13 +0000 (21:15 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Sat, 7 May 2011 16:15:13 +0000 (21:15 +0500)
core/s2smanager.lua

index a2379f22c0bd9bd02aea2a4cf85a0869a5edc303..f49fae9dc5ed54afb9f0cee325f0cd4ecaff5a21 100644 (file)
@@ -625,7 +625,7 @@ end
 
 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;