aboutsummaryrefslogtreecommitdiffstats
path: root/core/sessionmanager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/sessionmanager.lua')
-rw-r--r--core/sessionmanager.lua16
1 files changed, 2 insertions, 14 deletions
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index 05b2d64b..98ead07f 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -24,22 +24,10 @@ local uuid_generate = require "util.uuid".generate;
local initialize_filters = require "util.filters".initialize;
local gettime = require "socket".gettime;
-local newproxy = newproxy;
-local getmetatable = getmetatable;
-
module "sessionmanager"
-local open_sessions = 0;
-
function new_session(conn)
local session = { conn = conn, type = "c2s_unauthed", conntime = gettime() };
- if true then
- session.trace = newproxy(true);
- getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; end;
- end
- open_sessions = open_sessions + 1;
- log("debug", "open sessions now: %d", open_sessions);
-
local filter = initialize_filters(session);
local w = conn.write;
session.send = function (t)
@@ -72,7 +60,7 @@ local resting_session = { -- Resting, not dead
function retire_session(session)
local log = session.log or log;
for k in pairs(session) do
- if k ~= "trace" and k ~= "log" and k ~= "id" then
+ if k ~= "log" and k ~= "id" then
session[k] = nil;
end
end
@@ -140,7 +128,7 @@ function bind_resource(session, resource)
local sessions = hosts[session.host].sessions[session.username].sessions;
if sessions[resource] then
-- Resource conflict
- local policy = config_get(session.host, "core", "conflict_resolve");
+ local policy = config_get(session.host, "conflict_resolve");
local increment;
if policy == "random" then
resource = uuid_generate();