# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1358985497 -3600
# Node ID 10bc0e2aa55eb63a04e16687709d5417a968e40d
# Parent  391b72fede9f6e7d55b7208536c3b7ed4da1bedd
s2smanager: Generate session names used for logging the same way everywhere

diff -r 391b72fede9f -r 10bc0e2aa55e core/s2smanager.lua
--- 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
diff -r 391b72fede9f -r 10bc0e2aa55e core/sessionmanager.lua
--- 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;
diff -r 391b72fede9f -r 10bc0e2aa55e plugins/mod_component.lua
--- 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;