pidgin: 0394d7df: Only disconnect xmpp connections during ...

nosnilmot at pidgin.im nosnilmot at pidgin.im
Fri Aug 22 17:00:28 EDT 2008


-----------------------------------------------------------------
Revision: 0394d7df6e47a5fa45b9a961d47614562888683e
Ancestor: c8fbd6cc379e71ae9b25947731b1ad6c6570ffb5
Author: nosnilmot at pidgin.im
Date: 2008-08-22T20:54:24
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/0394d7df6e47a5fa45b9a961d47614562888683e

Modified files:
        libpurple/protocols/jabber/parser.c

ChangeLog: 

Only disconnect xmpp connections during xml parsing if the error is an
unrecoverable/fatal error.

Fixes #6634

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/parser.c	f87f5766fa019332da36d7cda69c8939d68fe074
+++ libpurple/protocols/jabber/parser.c	c6ff50a2468313d3a6d982b7bd324e280fb92c20
@@ -207,13 +207,11 @@ void jabber_parser_process(JabberStream 
 		js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL);
 		xmlParseChunk(js->context, "", 0, 0);
 	} else if ((ret = xmlParseChunk(js->context, buf, len, 0)) != XML_ERR_OK) {
-		purple_debug_error("jabber", "xmlParseChunk returned error %i", ret);
+		xmlError *err = xmlCtxtGetLastError(js->context);
 
-		if ((ret >= XML_ERR_INVALID_HEX_CHARREF) && (ret <= XML_ERR_INVALID_CHAR)) {
-			/* If the error involves an invalid character, just drop this message.
-			 * We'll create a new parser next time it's needed. */
-			jabber_parser_free(js);
-		} else {
+		purple_debug_error("jabber", "xmlParseChunk returned error %i\n", ret);
+
+		if (err->level == XML_ERR_FATAL) {
 			purple_connection_error_reason (js->gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 				_("XML Parse error"));


More information about the Commits mailing list