aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-03-29 23:05:08 +0100
committerKim Alvefur <zash@zash.se>2019-03-29 23:05:08 +0100
commitae1009d110d6abd42ba1f8c1698811ff947e99f1 (patch)
treeb851404874bbaef21236810e9d73a14f696f2870
parent1ec8b4510430479da2cb404f03fd1067dae45c82 (diff)
downloadprosody-ae1009d110d6abd42ba1f8c1698811ff947e99f1.tar.gz
prosody-ae1009d110d6abd42ba1f8c1698811ff947e99f1.zip
core.sessionmanager: Use util.session to create sessions
-rw-r--r--core/sessionmanager.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index 9a2456f2..f5af1185 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -21,6 +21,7 @@ local config_get = require "core.configmanager".get;
local resourceprep = require "util.encodings".stringprep.resourceprep;
local nodeprep = require "util.encodings".stringprep.nodeprep;
local generate_identifier = require "util.id".short;
+local sessionlib = require "util.session";
local initialize_filters = require "util.filters".initialize;
local gettime = require "socket".gettime;
@@ -29,7 +30,12 @@ local _ENV = nil;
-- luacheck: std none
local function new_session(conn)
- local session = { conn = conn, type = "c2s_unauthed", conntime = gettime() };
+ local session = sessionlib.new("c2s");
+ sessionlib.set_id(session);
+ sessionlib.set_logger(session);
+ sessionlib.set_conn(session, conn);
+
+ session.conntime = gettime();
local filter = initialize_filters(session);
local w = conn.write;