Changeset

1686:232c2bf155c7

core.s2smanager, xmppserver_listener: Move the responsibility of setting session.log from the latter to the former for incoming sessions (outgoing are already like this)
author Matthew Wild <mwild1@gmail.com>
date Sun, 16 Aug 2009 21:41:53 +0100
parents 1685:f5e24a63d233
children 1712:45a81d6d8777
files core/s2smanager.lua net/xmppserver_listener.lua
diffstat 2 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Sun Aug 16 21:37:47 2009 +0100
+++ b/core/s2smanager.lua	Sun Aug 16 21:41:53 2009 +0100
@@ -126,6 +126,7 @@
 	end
 	open_sessions = open_sessions + 1;
 	local w, log = conn.write, logger_init("s2sin"..tostring(conn):match("[a-f0-9]+$"));
+	session.log = log;
 	session.sends2s = function (t) log("debug", "sending: %s", tostring(t)); w(tostring(t)); end
 	incoming_s2s[session] = true;
 	return session;
--- a/net/xmppserver_listener.lua	Sun Aug 16 21:37:47 2009 +0100
+++ b/net/xmppserver_listener.lua	Sun Aug 16 21:41:53 2009 +0100
@@ -114,12 +114,6 @@
 		session = s2s_new_incoming(conn);
 		sessions[conn] = session;
 
-		-- Logging functions --
-
-		
-		local conn_name = "s2sin"..tostring(conn):match("[a-f0-9]+$");
-		session.log = logger.init(conn_name);
-		
 		session.log("info", "Incoming s2s connection");
 		
 		session.reset_stream = session_reset_stream;