# HG changeset patch # User Matthew Wild # Date 1263873500 0 # Node ID 68bb1cc1a8b06b1b82b25fc2543a661c7e1270dd # Parent 8098310d0dfd3b14e08ad7fa11adcc0f4bfa5c4b xmlhandlers: Move stream-error detection to somewhere more appropriate (it was never reached) - s2s stream errors now reported properly diff -r 8098310d0dfd -r 68bb1cc1a8b0 core/xmlhandlers.lua --- a/core/xmlhandlers.lua Tue Jan 19 03:57:19 2010 +0000 +++ b/core/xmlhandlers.lua Tue Jan 19 03:58:20 2010 +0000 @@ -116,13 +116,11 @@ 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 @@ 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();