Software /
code /
prosody
Comparison
net/xmppserver_listener.lua @ 1040:4c79b28bce64
xmpp{server,client}_listener: Fix global accesses
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 22 Apr 2009 20:42:56 +0100 |
parent | 990:235abebc896e |
child | 1523:841d61be198f |
comparison
equal
deleted
inserted
replaced
1039:cc4280f45d0e | 1040:4c79b28bce64 |
---|---|
7 -- | 7 -- |
8 | 8 |
9 | 9 |
10 | 10 |
11 local logger = require "logger"; | 11 local logger = require "logger"; |
12 local log = logger.init("xmppserver_listener"); | |
12 local lxp = require "lxp" | 13 local lxp = require "lxp" |
13 local init_xmlhandlers = require "core.xmlhandlers" | 14 local init_xmlhandlers = require "core.xmlhandlers" |
14 local sm_new_session = require "core.sessionmanager".new_session; | |
15 local s2s_new_incoming = require "core.s2smanager".new_incoming; | 15 local s2s_new_incoming = require "core.s2smanager".new_incoming; |
16 local s2s_streamopened = require "core.s2smanager".streamopened; | 16 local s2s_streamopened = require "core.s2smanager".streamopened; |
17 local s2s_streamclosed = require "core.s2smanager".streamclosed; | 17 local s2s_streamclosed = require "core.s2smanager".streamclosed; |
18 local s2s_destroy_session = require "core.s2smanager".destroy_session; | 18 local s2s_destroy_session = require "core.s2smanager".destroy_session; |
19 local s2s_attempt_connect = require "core.s2smanager".attempt_connection; | 19 local s2s_attempt_connect = require "core.s2smanager".attempt_connection; |
40 local t_insert = table.insert; | 40 local t_insert = table.insert; |
41 local t_concat = table.concat; | 41 local t_concat = table.concat; |
42 local t_concatall = function (t, sep) local tt = {}; for _, s in ipairs(t) do t_insert(tt, tostring(s)); end return t_concat(tt, sep); end | 42 local t_concatall = function (t, sep) local tt = {}; for _, s in ipairs(t) do t_insert(tt, tostring(s)); end return t_concat(tt, sep); end |
43 local m_random = math.random; | 43 local m_random = math.random; |
44 local format = string.format; | 44 local format = string.format; |
45 local sm_new_session, sm_destroy_session = sessionmanager.new_session, sessionmanager.destroy_session; --import("core.sessionmanager", "new_session", "destroy_session"); | 45 local sessionmanager = require "core.sessionmanager"; |
46 local st = stanza; | 46 local sm_new_session, sm_destroy_session = sessionmanager.new_session, sessionmanager.destroy_session; |
47 local st = require "util.stanza"; | |
47 | 48 |
48 local sessions = {}; | 49 local sessions = {}; |
49 local xmppserver = { default_port = 5269, default_mode = "*a" }; | 50 local xmppserver = { default_port = 5269, default_mode = "*a" }; |
50 | 51 |
51 -- These are session methods -- | 52 -- These are session methods -- |