pidgin: 1804a149: Added a structured error handler callbac...

evands at pidgin.im evands at pidgin.im
Fri Jul 4 11:46:15 EDT 2008


-----------------------------------------------------------------
Revision: 1804a14989f21be74dc8231273cf399cd81b45e7
Ancestor: fb08a15c49ea1cffb1eb5b50f9cd8c3d57dec5dd
Author: evands at pidgin.im
Date: 2008-07-04T15:41:26
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1804a14989f21be74dc8231273cf399cd81b45e7

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

ChangeLog: 

Added a structured error handler callback to the xmlSAXHandler struct.
This callback is used preferentially over the warning/error/fatal_error
callbacks (whcih we don't implement, anyways) for 'modules which support the
new error reporting mechanism'. This should help us detect parsing errors.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/parser.c	9ab56d28740cacf167e31733831b10a7e92a41c3
+++ libpurple/protocols/jabber/parser.c	f071b3d656f29726a14c902ff16439a574657565
@@ -132,6 +132,18 @@ jabber_parser_element_text_libxml(void *
 	xmlnode_insert_data(js->current, (const char*) text, text_len);
 }
 
+static void
+jabber_parser_structured_error_handler(void *user_data, xmlErrorPtr error)
+{
+	JabberStream *js = user_data;
+
+	purple_debug_error("jabber", "XML parser error for JabberStream %p: "
+								 "Domain %i, code %i, level %i: %s\n",
+					   js,
+					   error->domain, error->code, error->level,
+					   (error->message ? error->message : "(null)"));
+}
+
 static xmlSAXHandler jabber_parser_libxml = {
 	NULL,									/*internalSubset*/
 	NULL,									/*isStandalone*/
@@ -164,7 +176,7 @@ static xmlSAXHandler jabber_parser_libxm
 	NULL,									/*_private*/
 	jabber_parser_element_start_libxml,		/*startElementNs*/
 	jabber_parser_element_end_libxml,		/*endElementNs*/
-	NULL									/*serror*/
+	jabber_parser_structured_error_handler	/*serror*/
 };
 
 void


More information about the Commits mailing list