aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-12-15 03:52:56 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-12-15 03:52:56 +0500
commit7463bac8a02b838dc8154d4fbe3237aa01a922d8 (patch)
treef74dbd68af2725a15a199317acff366e8c2d77e6 /net
parent812627cb6091797db365dc0459109cf7f8c45057 (diff)
downloadprosody-7463bac8a02b838dc8154d4fbe3237aa01a922d8.tar.gz
prosody-7463bac8a02b838dc8154d4fbe3237aa01a922d8.zip
net.xmppserver_listener: Made some globals local.
Diffstat (limited to 'net')
-rw-r--r--net/xmppserver_listener.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua
index 6b782240..f2d70ae6 100644
--- a/net/xmppserver_listener.lua
+++ b/net/xmppserver_listener.lua
@@ -7,6 +7,11 @@
--
+local tostring = tostring;
+local type = type;
+local xpcall = xpcall;
+local s_format = string.format;
+local traceback = debug.traceback;
local logger = require "logger";
local log = logger.init("xmppserver_listener");
@@ -48,7 +53,7 @@ function stream_callbacks.error(session, error, data)
end
end
-local function handleerr(err) log("error", "Traceback[s2s]: %s: %s", tostring(err), debug.traceback()); end
+local function handleerr(err) log("error", "Traceback[s2s]: %s: %s", tostring(err), traceback()); end
function stream_callbacks.handlestanza(session, stanza)
if stanza.attr.xmlns == "jabber:client" then --COMPAT: Prosody pre-0.6.2 may send jabber:client
stanza.attr.xmlns = nil;
@@ -173,9 +178,9 @@ function xmppserver.onstatus(conn, status)
if status == "ssl-handshake-complete" then
local session = sessions[conn];
if session and session.direction == "outgoing" then
- local format, to_host, from_host = string.format, session.to_host, session.from_host;
+ local to_host, from_host = session.to_host, session.from_host;
session.log("debug", "Sending stream header...");
- session.sends2s(format([[<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' from='%s' to='%s' version='1.0'>]], from_host, to_host));
+ session.sends2s(s_format([[<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' from='%s' to='%s' version='1.0'>]], from_host, to_host));
end
end
end