From 392eac3c621a11d30d9e42803faaf93cdb48d83d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 3 Apr 2019 17:20:57 +0200 Subject: util.session: Fix session id not include unauthed forever --- util/session.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'util/session.lua') diff --git a/util/session.lua b/util/session.lua index b2a726ce..b9c6bec7 100644 --- a/util/session.lua +++ b/util/session.lua @@ -4,12 +4,13 @@ local logger = require "util.logger"; local function new_session(typ) local session = { type = typ .. "_unauthed"; + base_type = typ; }; return session; end local function set_id(session) - local id = session.type .. tostring(session):match("%x+$"):lower(); + local id = session.base_type .. tostring(session):match("%x+$"):lower(); session.id = id; return session; end -- cgit v1.2.3 From 0e16eeb216d52e4cce2457fae31e1618a8b6e446 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 30 Jul 2019 02:24:06 +0200 Subject: util.session: Remove tostring call from logging Taken care of by loggingmanager now --- util/session.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/session.lua') diff --git a/util/session.lua b/util/session.lua index b9c6bec7..25b22faf 100644 --- a/util/session.lua +++ b/util/session.lua @@ -31,7 +31,7 @@ local function set_send(session) local conn = session.conn; if not conn then function session.send(data) - session.log("debug", "Discarding data sent to unconnected session: %s", tostring(data)); + session.log("debug", "Discarding data sent to unconnected session: %s", data); return false; end return session; @@ -47,7 +47,7 @@ local function set_send(session) if t then local ret, err = w(conn, t); if not ret then - session.log("debug", "Error writing to connection: %s", tostring(err)); + session.log("debug", "Error writing to connection: %s", err); return false, err; end end -- cgit v1.2.3