diff options
author | Matthew Wild <mwild1@gmail.com> | 2013-07-09 00:04:30 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2013-07-09 00:04:30 +0100 |
commit | b5ccfb0d7836918c0a65688df2f52e593304d83c (patch) | |
tree | a16ad67f4b3c386fb97dbe164983fe2f51e4b125 | |
parent | 316d5d6e0833d55bb49d8a2f8ba8afd9b6dd2ba5 (diff) | |
parent | 98ce25306381896a2502e833f1e218d7c599cc4e (diff) | |
download | prosody-b5ccfb0d7836918c0a65688df2f52e593304d83c.tar.gz prosody-b5ccfb0d7836918c0a65688df2f52e593304d83c.zip |
Merge 0.9->trunk
-rw-r--r-- | plugins/mod_bosh.lua | 7 | ||||
-rw-r--r-- | plugins/mod_component.lua | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index 9a612ae0..d8717d18 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -20,6 +20,8 @@ local logger = require "util.logger"; local log = logger.init("mod_bosh"); local initialize_filters = require "util.filters".initialize; local math_min = math.min; +local xpcall, tostring, type = xpcall, tostring, type; +local traceback = debug.traceback; local xmlns_streams = "http://etherx.jabber.org/streams"; local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams"; @@ -353,6 +355,7 @@ function stream_callbacks.streamopened(context, attr) end end +local function handleerr(err) log("error", "Traceback[bosh]: %s", traceback(tostring(err), 2)); end function stream_callbacks.handlestanza(context, stanza) if context.ignore then return; end log("debug", "BOSH stanza received: %s\n", stanza:top_tag()); @@ -362,7 +365,9 @@ function stream_callbacks.handlestanza(context, stanza) stanza.attr.xmlns = nil; end stanza = session.filter("stanzas/in", stanza); - core_process_stanza(session, stanza); + if stanza then + return xpcall(function () return core_process_stanza(session, stanza) end, handleerr); + end end end diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index 2fde57ee..a5767c9a 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -9,6 +9,7 @@ module:set_global(); local t_concat = table.concat; +local xpcall, tostring, type = xpcall, tostring, type; local traceback = debug.traceback; local logger = require "util.logger"; |