aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-01-19 03:58:20 +0000
committerMatthew Wild <mwild1@gmail.com>2010-01-19 03:58:20 +0000
commit9858c0f2fc72965fd2410b98fe894ae11f42a259 (patch)
tree7416a1a09522a58db5142145f1fa7a40ad3681fc
parent81222a41d407743675728501d477578f511ed4a7 (diff)
downloadprosody-9858c0f2fc72965fd2410b98fe894ae11f42a259.tar.gz
prosody-9858c0f2fc72965fd2410b98fe894ae11f42a259.zip
xmlhandlers: Move stream-error detection to somewhere more appropriate (it was never reached) - s2s stream errors now reported properly
-rw-r--r--core/xmlhandlers.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua
index 6e693d86..f3310fb9 100644
--- a/core/xmlhandlers.lua
+++ b/core/xmlhandlers.lua
@@ -116,13 +116,11 @@ function init_xmlhandlers(session, stream_callbacks)
if name == "" then
curr_ns, name = "", curr_ns;
end
- if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then
+ if not stanza then
if tagname == stream_tag then
if cb_streamclosed then
cb_streamclosed(session);
end
- elseif name == "error" then
- cb_error(session, "stream-error", stanza);
else
cb_error(session, "parse-error", "unexpected-element-close", name);
end
@@ -136,7 +134,11 @@ function init_xmlhandlers(session, stream_callbacks)
end
-- Complete stanza
if #stanza.last_add == 0 then
- cb_handlestanza(session, stanza);
+ if tagname ~= stream_error_tag then
+ cb_handlestanza(session, stanza);
+ else
+ cb_error(session, "stream-error", stanza);
+ end
stanza = nil;
else
stanza:up();