Changeset

3873:9bc569083226

net.xmppserver_listener: Made some globals local.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 15 Dec 2010 03:52:56 +0500
parents 3872:cbfa3ab250f7
children 3874:1488fd9d3fa5
files net/xmppserver_listener.lua
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/net/xmppserver_listener.lua	Wed Dec 15 03:33:00 2010 +0500
+++ b/net/xmppserver_listener.lua	Wed Dec 15 03:52:56 2010 +0500
@@ -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 @@
 	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 @@
 	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