aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/http.lua4
-rw-r--r--net/httpserver.lua4
-rw-r--r--net/server.lua4
-rw-r--r--net/xmppclient_listener.lua6
-rw-r--r--net/xmppserver_listener.lua7
5 files changed, 14 insertions, 11 deletions
diff --git a/net/http.lua b/net/http.lua
index 29da41ea..24828ffe 100644
--- a/net/http.lua
+++ b/net/http.lua
@@ -9,8 +9,8 @@ local connlisteners_get = require "net.connlisteners".get;
local listener = connlisteners_get("httpclient") or error("No httpclient listener!");
local t_insert, t_concat = table.insert, table.concat;
-local tonumber, tostring, pairs, xpcall, select, debug_traceback =
- tonumber, tostring, pairs, xpcall, select, debug.traceback;
+local tonumber, tostring, pairs, xpcall, select, debug_traceback, char =
+ tonumber, tostring, pairs, xpcall, select, debug.traceback, string.char;
local log = require "util.logger".init("http");
local print = function () end
diff --git a/net/httpserver.lua b/net/httpserver.lua
index b16e7f3a..79cf33c2 100644
--- a/net/httpserver.lua
+++ b/net/httpserver.lua
@@ -8,10 +8,10 @@ local connlisteners_get = require "net.connlisteners".get;
local listener;
local t_insert, t_concat = table.insert, table.concat;
-local s_match, s_gmatch = string.match, string.gmatch;
+local s_match, s_gmatch, s_char = string.match, string.gmatch;
local tonumber, tostring, pairs = tonumber, tostring, pairs;
-local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end });
+local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = s_char(tonumber("0x"..k)); return t[k]; end });
local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end
local log = require "util.logger".init("httpserver");
diff --git a/net/server.lua b/net/server.lua
index 77bc2f5c..fd6459e8 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -786,7 +786,7 @@ local wrapclient = function( socket, ip, serverport, listeners, pattern, sslctx,
end
local addclient = function( address, port, listeners, pattern, sslctx, startssl )
- local client, err = socket.tcp( )
+ local client, err = luasocket.tcp( )
if err then
return nil, err
end
@@ -795,7 +795,7 @@ local addclient = function( address, port, listeners, pattern, sslctx, startssl
if err then -- try again
local handler = wrapclient( client, address, port, listeners )
else
- wrapconnection( server, listeners, socket, address, port, "clientport", pattern, sslctx, startssl )
+ wrapconnection( nil, listeners, client, address, port, "clientport", pattern, sslctx, startssl )
end
end
diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua
index 44852834..dbb87b91 100644
--- a/net/xmppclient_listener.lua
+++ b/net/xmppclient_listener.lua
@@ -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_concat = table.concat;
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",
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua
index 0216e8dc..ddfb185e 100644
--- a/net/xmppserver_listener.lua
+++ b/net/xmppserver_listener.lua
@@ -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_concat = table.concat;
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" };