# HG changeset patch # User Evan Schoenberg # Date 1215188075 0 # Node ID ce361cc8e43b5fe5e331f2d7c1abe63eb5abf61a # Parent 0eca6c183d60db04a6cf67041c44ce4df5a5a8ad Drop and then recover from XML messages which trigger invalid character errors rather than disconnecting. diff -r 0eca6c183d60 -r ce361cc8e43b libpurple/protocols/jabber/parser.c --- a/libpurple/protocols/jabber/parser.c Fri Jul 04 16:07:20 2008 +0000 +++ b/libpurple/protocols/jabber/parser.c Fri Jul 04 16:14:35 2008 +0000 @@ -209,9 +209,15 @@ } else if ((ret = xmlParseChunk(js->context, buf, len, 0)) != XML_ERR_OK) { purple_debug_error("jabber", "xmlParseChunk returned error %i", ret); - purple_connection_error_reason (js->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("XML Parse error")); + 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_connection_error_reason (js->gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, + _("XML Parse error")); + } } }