Comparison

core/sessionmanager.lua @ 1469:9f2b6e2bc498

sessionmanager: Newly created sessions shouldn't have a priority. Fixes one of the stanza-gobbling bugs \o/
author Matthew Wild <mwild1@gmail.com>
date Fri, 03 Jul 2009 21:37:09 +0100
parent 1450:c1c7b27b983b
child 1471:8b3753b080fc
comparison
equal deleted inserted replaced
1468:83b297a412a2 1469:9f2b6e2bc498
38 module "sessionmanager" 38 module "sessionmanager"
39 39
40 local open_sessions = 0; 40 local open_sessions = 0;
41 41
42 function new_session(conn) 42 function new_session(conn)
43 local session = { conn = conn, priority = 0, type = "c2s_unauthed", conntime = gettime() }; 43 local session = { conn = conn, type = "c2s_unauthed", conntime = gettime() };
44 if true then 44 if true then
45 session.trace = newproxy(true); 45 session.trace = newproxy(true);
46 getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; end; 46 getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; end;
47 end 47 end
48 open_sessions = open_sessions + 1; 48 open_sessions = open_sessions + 1;