Changeset

5306:10bc0e2aa55e

s2smanager: Generate session names used for logging the same way everywhere
author Kim Alvefur <zash@zash.se>
date Thu, 24 Jan 2013 00:58:17 +0100
parents 5305:391b72fede9f
children 5307:d80e56d8805c
files core/s2smanager.lua core/sessionmanager.lua plugins/mod_component.lua
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Thu Jan 24 00:58:03 2013 +0100
+++ b/core/s2smanager.lua	Thu Jan 24 00:58:17 2013 +0100
@@ -35,7 +35,7 @@
 		getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; end;
 	end
 	open_sessions = open_sessions + 1;
-	session.log = logger_init("s2sin"..tostring(conn):match("[a-f0-9]+$"));
+	session.log = logger_init("s2sin"..tostring(session):match("[a-f0-9]+$"));
 	incoming_s2s[session] = true;
 	return session;
 end
--- a/core/sessionmanager.lua	Thu Jan 24 00:58:03 2013 +0100
+++ b/core/sessionmanager.lua	Thu Jan 24 00:58:17 2013 +0100
@@ -54,7 +54,7 @@
 		end
 	end
 	session.ip = conn:ip();
-	local conn_name = "c2s"..tostring(conn):match("[a-f0-9]+$");
+	local conn_name = "c2s"..tostring(session):match("[a-f0-9]+$");
 	session.log = logger.init(conn_name);
 		
 	return session;
--- a/plugins/mod_component.lua	Thu Jan 24 00:58:03 2013 +0100
+++ b/plugins/mod_component.lua	Thu Jan 24 00:58:17 2013 +0100
@@ -260,7 +260,7 @@
 	local session = { type = "component_unauthed", conn = conn, send = function (data) return _send(conn, tostring(data)); end };
 
 	-- Logging functions --
-	local conn_name = "jcp"..tostring(conn):match("[a-f0-9]+$");
+	local conn_name = "jcp"..tostring(session):match("[a-f0-9]+$");
 	session.log = logger.init(conn_name);
 	session.close = session_close;