Software /
code /
prosody
Comparison
core/s2smanager.lua @ 5447:92b88476873a
sessionmanager, s2smanager: Remove open_session tracing
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 08 Apr 2013 15:53:18 +0100 |
parent | 5367:56db8f2c8563 |
child | 5459:3a821511b9ec |
comparison
equal
deleted
inserted
replaced
5445:9054b51e71a4 | 5447:92b88476873a |
---|---|
22 local incoming_s2s = incoming_s2s; | 22 local incoming_s2s = incoming_s2s; |
23 local fire_event = prosody.events.fire_event; | 23 local fire_event = prosody.events.fire_event; |
24 | 24 |
25 module "s2smanager" | 25 module "s2smanager" |
26 | 26 |
27 local open_sessions = 0; | |
28 | |
29 function new_incoming(conn) | 27 function new_incoming(conn) |
30 local session = { conn = conn, type = "s2sin_unauthed", direction = "incoming", hosts = {} }; | 28 local session = { conn = conn, type = "s2sin_unauthed", direction = "incoming", hosts = {} }; |
31 if true then | |
32 session.trace = newproxy(true); | |
33 getmetatable(session.trace).__gc = function () open_sessions = open_sessions - 1; end; | |
34 end | |
35 open_sessions = open_sessions + 1; | |
36 session.log = logger_init("s2sin"..tostring(session):match("[a-f0-9]+$")); | 29 session.log = logger_init("s2sin"..tostring(session):match("[a-f0-9]+$")); |
37 incoming_s2s[session] = true; | 30 incoming_s2s[session] = true; |
38 return session; | 31 return session; |
39 end | 32 end |
40 | 33 |
60 }; resting_session.__index = resting_session; | 53 }; resting_session.__index = resting_session; |
61 | 54 |
62 function retire_session(session, reason) | 55 function retire_session(session, reason) |
63 local log = session.log or log; | 56 local log = session.log or log; |
64 for k in pairs(session) do | 57 for k in pairs(session) do |
65 if k ~= "trace" and k ~= "log" and k ~= "id" and k ~= "conn" then | 58 if k ~= "log" and k ~= "id" and k ~= "conn" then |
66 session[k] = nil; | 59 session[k] = nil; |
67 end | 60 end |
68 end | 61 end |
69 | 62 |
70 session.destruction_reason = reason; | 63 session.destruction_reason = reason; |