aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-07-08 21:41:31 +0100
committerMatthew Wild <mwild1@gmail.com>2013-07-08 21:41:31 +0100
commit316d5d6e0833d55bb49d8a2f8ba8afd9b6dd2ba5 (patch)
treec26e0fdeb8230cec51561eb0c5dfeda12ab1d7ce /plugins
parent14cde80a1f8570920e598509710f2dc61b7a2510 (diff)
parentfb9838c64b97cd51c87a6cc251a6049e11eeba94 (diff)
downloadprosody-316d5d6e0833d55bb49d8a2f8ba8afd9b6dd2ba5.tar.gz
prosody-316d5d6e0833d55bb49d8a2f8ba8afd9b6dd2ba5.zip
Merge 0.9->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_component.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index 871a20e4..2fde57ee 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -9,6 +9,7 @@
module:set_global();
local t_concat = table.concat;
+local traceback = debug.traceback;
local logger = require "util.logger";
local sha1 = require "util.hashes".sha1;
@@ -183,6 +184,7 @@ function stream_callbacks.streamclosed(session)
session:close();
end
+local function handleerr(err) log("error", "Traceback[component]: %s", traceback(tostring(err), 2)); end
function stream_callbacks.handlestanza(session, stanza)
-- Namespaces are icky.
if not stanza.attr.xmlns and stanza.name == "handshake" then
@@ -213,7 +215,10 @@ function stream_callbacks.handlestanza(session, stanza)
return;
end
end
- return core_process_stanza(session, stanza);
+
+ if stanza then
+ return xpcall(function () return core_process_stanza(session, stanza) end, handleerr);
+ end
end
--- Closing a component connection