From 6e9784727f51c2aff07c8bfbdead6ab78cce7269 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 13 Jun 2012 11:47:04 +0500 Subject: s2smanager: Fix a traceback when we close a s2s connection ourselves (thanks for the testing Zash). --- core/s2smanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/s2smanager.lua') diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 9e0a91d1..5fe3a375 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -133,7 +133,7 @@ local resting_session = { -- Resting, not dead function retire_session(session, reason) local log = session.log or log; for k in pairs(session) do - if k ~= "trace" and k ~= "log" and k ~= "id" then + if k ~= "trace" and k ~= "log" and k ~= "id" and k ~= "conn" then session[k] = nil; end end -- cgit v1.2.3 From e89b006f03f692a7e807c54757f0623302c40b85 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 23 Jul 2012 17:32:33 +0100 Subject: Hopefully inert commit to clean up logging across a number of modules, removing all cases of concatenation when building log messages --- core/s2smanager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/s2smanager.lua') diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 5fe3a375..ece90e8f 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -87,7 +87,7 @@ function mark_connected(session) local from, to = session.from_host, session.to_host; - session.log("info", session.direction.." s2s connection "..from.."->"..to.." complete"); + session.log("info", "%s s2s connection %s->%s complete", session.direction, from, to); local event_data = { session = session }; if session.type == "s2sout" then @@ -105,7 +105,7 @@ function mark_connected(session) if session.direction == "outgoing" then if sendq then - session.log("debug", "sending "..#sendq.." queued stanzas across new outgoing connection to "..session.to_host); + session.log("debug", "sending %d queued stanzas across new outgoing connection to %s", #sendq, session.to_host); for i, data in ipairs(sendq) do send(data[1]); sendq[i] = nil; -- cgit v1.2.3 From 249829afcb3933e8ce24252209400088a751ebf6 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 23 Jul 2012 17:35:18 +0100 Subject: s2smanager: Remove logging of (unknown) in a case where from_host and to_host should always be set --- core/s2smanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/s2smanager.lua') diff --git a/core/s2smanager.lua b/core/s2smanager.lua index ece90e8f..76dde9d2 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -74,7 +74,7 @@ function make_authenticated(session, host) else return false; end - session.log("debug", "connection %s->%s is now authenticated for %s", session.from_host or "(unknown)", session.to_host or "(unknown)", host); + session.log("debug", "connection %s->%s is now authenticated for %s", session.from_host, session.to_host, host); mark_connected(session); -- cgit v1.2.3