diff options
author | Kim Alvefur <zash@zash.se> | 2019-12-24 00:39:45 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-12-24 00:39:45 +0100 |
commit | 1eabf5bdb449b0312dfa272884e02cc84175775c (patch) | |
tree | 94b4ebcb9443e8e6751e1903ade3c9dc8ec9d678 /util/session.lua | |
parent | 575cd4c57d062a1addc761aa0036b1db752900a9 (diff) | |
parent | 8537138d41a6bca5e855040c8928ef2aae59802f (diff) | |
download | prosody-1eabf5bdb449b0312dfa272884e02cc84175775c.tar.gz prosody-1eabf5bdb449b0312dfa272884e02cc84175775c.zip |
Merge 0.11->trunk
Diffstat (limited to 'util/session.lua')
-rw-r--r-- | util/session.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/util/session.lua b/util/session.lua index b2a726ce..25b22faf 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 @@ -30,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; @@ -46,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 |