Changeset

1040:4c79b28bce64

xmpp{server,client}_listener: Fix global accesses
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Apr 2009 20:42:56 +0100
parents 1039:cc4280f45d0e
children 1041:07835534d996
files net/xmppclient_listener.lua net/xmppserver_listener.lua
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/net/xmppclient_listener.lua	Wed Apr 22 20:33:24 2009 +0100
+++ b/net/xmppclient_listener.lua	Wed Apr 22 20:42:56 2009 +0100
@@ -9,6 +9,7 @@
 
 
 local logger = require "logger";
+local log = logger.init("xmppclient_listener");
 local lxp = require "lxp"
 local init_xmlhandlers = require "core.xmlhandlers"
 local sm_new_session = require "core.sessionmanager".new_session;
@@ -20,10 +21,11 @@
 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
 local m_random = math.random;
 local format = string.format;
-local sm_new_session, sm_destroy_session = sessionmanager.new_session, sessionmanager.destroy_session; --import("core.sessionmanager", "new_session", "destroy_session");
+local sessionmanager = require "core.sessionmanager";
+local sm_new_session, sm_destroy_session = sessionmanager.new_session, sessionmanager.destroy_session;
 local sm_streamopened = sessionmanager.streamopened;
 local sm_streamclosed = sessionmanager.streamclosed;
-local st = stanza;
+local st = require "util.stanza";
 
 local stream_callbacks = { stream_tag = "http://etherx.jabber.org/streams|stream", 
 		default_ns = "jabber:client",
--- a/net/xmppserver_listener.lua	Wed Apr 22 20:33:24 2009 +0100
+++ b/net/xmppserver_listener.lua	Wed Apr 22 20:42:56 2009 +0100
@@ -9,9 +9,9 @@
 
 
 local logger = require "logger";
+local log = logger.init("xmppserver_listener");
 local lxp = require "lxp"
 local init_xmlhandlers = require "core.xmlhandlers"
-local sm_new_session = require "core.sessionmanager".new_session;
 local s2s_new_incoming = require "core.s2smanager".new_incoming;
 local s2s_streamopened = require "core.s2smanager".streamopened;
 local s2s_streamclosed = require "core.s2smanager".streamclosed;
@@ -42,8 +42,9 @@
 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
 local m_random = math.random;
 local format = string.format;
-local sm_new_session, sm_destroy_session = sessionmanager.new_session, sessionmanager.destroy_session; --import("core.sessionmanager", "new_session", "destroy_session");
-local st = stanza;
+local sessionmanager = require "core.sessionmanager";
+local sm_new_session, sm_destroy_session = sessionmanager.new_session, sessionmanager.destroy_session;
+local st = require "util.stanza";
 
 local sessions = {};
 local xmppserver = { default_port = 5269, default_mode = "*a" };