Diff

util/session.lua @ 7188:e8f20be3e6f8

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Mon, 22 Feb 2016 18:46:59 +0100
parent 7181:8af558965da3
child 9947:8ebca1240203
line wrap: on
line diff
--- a/util/session.lua	Mon Feb 22 15:24:20 2016 +0100
+++ b/util/session.lua	Mon Feb 22 18:46:59 2016 +0100
@@ -9,13 +9,13 @@
 end
 
 local function set_id(session)
-	local id = typ .. tostring(session):match("%x+$"):lower();
+	local id = session.type .. tostring(session):match("%x+$"):lower();
 	session.id = id;
 	return session;
 end
 
 local function set_logger(session)
-	local log = logger.init(id);
+	local log = logger.init(session.id);
 	session.log = log;
 	return session;
 end
@@ -30,7 +30,7 @@
 	local conn = session.conn;
 	if not conn then
 		function session.send(data)
-			log("debug", "Discarding data sent to unconnected session: %s", tostring(data));
+			session.log("debug", "Discarding data sent to unconnected session: %s", tostring(data));
 			return false;
 		end
 		return session;