aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-03-17 12:46:52 +0100
committerKim Alvefur <zash@zash.se>2016-03-17 12:46:52 +0100
commit4f0eecb472e8242eaeaf53e0dbc526609851a381 (patch)
tree271bad71a36adc72edb221f8271f8323db5a7514 /plugins
parent1fc7b4fca0cdbf91c32f22136dd31b93c36204bb (diff)
downloadprosody-4f0eecb472e8242eaeaf53e0dbc526609851a381.tar.gz
prosody-4f0eecb472e8242eaeaf53e0dbc526609851a381.zip
Backed out BOSH use of util.async (changeset f0687c313cf1)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bosh.lua16
1 files changed, 3 insertions, 13 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua
index fd33226c..840de725 100644
--- a/plugins/mod_bosh.lua
+++ b/plugins/mod_bosh.lua
@@ -22,7 +22,6 @@ 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";
@@ -229,8 +228,6 @@ 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;
@@ -263,10 +260,6 @@ 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);
@@ -364,11 +357,6 @@ 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());
@@ -378,7 +366,9 @@ function stream_callbacks.handlestanza(context, stanza)
stanza.attr.xmlns = nil;
end
stanza = session.filter("stanzas/in", stanza);
- session.thread:run(stanza);
+ if stanza then
+ return xpcall(function () return core_process_stanza(session, stanza) end, handleerr);
+ end
end
end