diff libpurple/protocols/bonjour/parser.c @ 25586:f424f26dd329

*** Plucked rev d34a1589 (darkrain42@pidgin.im): Feed a fake </stream:stream> to the XMPP parser to silence warnings. Upgrading to TLS and disconnecting should no longer emit 'Extra content at the end of the document' References #8830. *** Plucked rev ca9f6d5b (darkrain42@pidgin.im): Add xmlnode and bonjour structured error handlers. Various libraries may set global structured error handlers and libxml2 prefers those to a per-context normal error handler. This causes us to break badly. References #8830. *** Plucked rev 34f4897e (darkrain42@pidgin.im): xmlCtxtGetLastError may return NULL, especially with other misbehaving libraries in our address space. References #8136.
author Paul Aurich <paul@darkrain42.org>
date Wed, 29 Apr 2009 20:57:53 +0000
parents 1c87e81c44fa
children 01f1929d0936
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/parser.c	Wed Apr 29 19:39:11 2009 +0000
+++ b/libpurple/protocols/bonjour/parser.c	Wed Apr 29 20:57:53 2009 +0000
@@ -156,6 +156,18 @@
 	xmlnode_insert_data(bconv->current, (const char*) text, text_len);
 }
 
+static void
+bonjour_parser_structured_error_handler(void *user_data, xmlErrorPtr error)
+{
+	BonjourJabberConversation *bconv = user_data;
+
+	purple_debug_error("jabber", "XML parser error for BonjourJabberConversation %p: "
+	                             "Domain %i, code %i, level %i: %s",
+	                   bconv,
+	                   error->domain, error->code, error->level,
+	                   (error->message ? error->message : "(null)\n"));
+}
+
 static xmlSAXHandler bonjour_parser_libxml = {
 	NULL,									/*internalSubset*/
 	NULL,									/*isStandalone*/
@@ -188,7 +200,7 @@
 	NULL,									/*_private*/
 	bonjour_parser_element_start_libxml,	/*startElementNs*/
 	bonjour_parser_element_end_libxml,		/*endElementNs*/
-	NULL									/*serror*/
+	bonjour_parser_structured_error_handler /*serror*/
 };
 
 void