aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_telnet.lua1
-rw-r--r--plugins/mod_blocklist.lua2
-rw-r--r--plugins/mod_bosh.lua16
-rw-r--r--plugins/mod_http.lua1
-rw-r--r--plugins/mod_storage_sql2.lua2
5 files changed, 16 insertions, 6 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 9185ac1b..ee8a43dc 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -974,6 +974,7 @@ function def_env.muc:list(host)
if not host_session or not host_session.modules.muc then
return nil, "Please supply the address of a local MUC component";
end
+ local print = self.session.print;
local c = 0;
for room in host_session.modules.muc.each_room() do
print(room.jid);
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua
index 70bfb5fc..81bdd2c6 100644
--- a/plugins/mod_blocklist.lua
+++ b/plugins/mod_blocklist.lua
@@ -13,7 +13,7 @@ local user_exists = require"core.usermanager".user_exists;
local is_contact_subscribed = require"core.rostermanager".is_contact_subscribed;
local st = require"util.stanza";
local st_error_reply = st.error_reply;
-local jid_prep, jid_split = import("jid", "prep", "split");
+local jid_prep, jid_split = import("util.jid", "prep", "split");
local host = module.host;
local storage = module:open_store();
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index ca67db73..9e8354fe 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -22,6 +22,7 @@ local initialize_filters = require "util.filters".initialize;
local math_min = math.min;
local xpcall, tostring, type = xpcall, tostring, type;
local traceback = debug.traceback;
+local runner = require"util.async".runner;
local xmlns_streams = "http://etherx.jabber.org/streams";
local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
@@ -228,6 +229,8 @@ local function bosh_close_stream(session, reason)
sm_destroy_session(session);
end
+local runner_callbacks = { };
+
-- Handle the <body> tag in the request payload.
function stream_callbacks.streamopened(context, attr)
local request, response = context.request, context.response;
@@ -260,6 +263,10 @@ function stream_callbacks.streamopened(context, attr)
};
sessions[sid] = session;
+ session.thread = runner(function (stanza)
+ session:dispatch_stanza(stanza);
+ end, runner_callbacks, session);
+
local filter = initialize_filters(session);
session.log("debug", "BOSH session created for request from %s", session.ip);
@@ -355,6 +362,11 @@ function stream_callbacks.streamopened(context, attr)
end
local function handleerr(err) log("error", "Traceback[bosh]: %s", traceback(tostring(err), 2)); end
+
+function runner_callbacks:error(err)
+ return handleerr(err);
+end
+
function stream_callbacks.handlestanza(context, stanza)
if context.ignore then return; end
log("debug", "BOSH stanza received: %s\n", stanza:top_tag());
@@ -364,9 +376,7 @@ function stream_callbacks.handlestanza(context, stanza)
stanza.attr.xmlns = nil;
end
stanza = session.filter("stanzas/in", stanza);
- if stanza then
- return xpcall(function () return core_process_stanza(session, stanza) end, handleerr);
- end
+ session.thread:run(stanza);
end
end
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index 8bda1cac..76ee151b 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -84,6 +84,7 @@ function module.add_host(module)
local app_name = event.item.name;
local default_app_path = event.item.default_path or "/"..app_name;
local app_path = get_base_path(module, app_name, default_app_path);
+ module:log("debug", "Serving '%s' at %s", app_name, module:http_url(app_name, app_path));
if not app_name then
-- TODO: Link to docs
module:log("error", "HTTP app has no 'name', add one or use module:provides('http', app)");
diff --git a/plugins/mod_storage_sql2.lua b/plugins/mod_storage_sql2.lua
index e5357416..a637c9dc 100644
--- a/plugins/mod_storage_sql2.lua
+++ b/plugins/mod_storage_sql2.lua
@@ -113,8 +113,6 @@ do -- process options to get a db connection
--local dburi = db2uri(params);
engine = mod_sql:create_engine(params);
- engine:set_encoding();
-
if module:get_option("sql_manage_tables", true) then
-- Automatically create table, ignore failure (table probably already exists)
create_table();