Changeset

2037:a919511c45ac

xmlhandlers: Reset state on error or stream close, fixes possible traceback
author Matthew Wild <mwild1@gmail.com>
date Wed, 21 Oct 2009 14:05:33 +0100
parents 2036:0f9c121713e1
children 2038:4ab83f96585a
files core/xmlhandlers.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/xmlhandlers.lua	Wed Oct 21 13:59:54 2009 +0100
+++ b/core/xmlhandlers.lua	Wed Oct 21 14:05:33 2009 +0100
@@ -114,12 +114,13 @@
 					if cb_streamclosed then
 						cb_streamclosed(session);
 					end
-					return;
 				elseif name == "error" then
 					cb_error(session, "stream-error", stanza);
 				else
 					cb_error(session, "parse-error", "unexpected-element-close", name);
 				end
+				stanza, chardata = nil, {};
+				return;
 			end
 			if #chardata > 0 then
 				-- We have some character data in the buffer