pidgin: 5b81e4f3: Make XML parsing error levels match libx...

nosnilmot at pidgin.im nosnilmot at pidgin.im
Tue Jan 6 20:25:38 EST 2009


-----------------------------------------------------------------
Revision: 5b81e4f377729224dc9d281820432e7bd6c637b7
Ancestor: bf1a6512656e8ca55b15aa2d47f380b190ba359c
Author: nosnilmot at pidgin.im
Date: 2009-01-07T01:18:16
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5b81e4f377729224dc9d281820432e7bd6c637b7

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

ChangeLog: 

Make XML parsing error levels match libxml2's levels, making less important
errors less scary in the debug window

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/parser.c	543d6e2fa1f94a7d9884851e9fb7b8951988f9f7
+++ libpurple/protocols/jabber/parser.c	c3df562882edc4bc0389b57d0a1049505e8e1a25
@@ -234,12 +234,22 @@ void jabber_parser_process(JabberStream 
 	} else if ((ret = xmlParseChunk(js->context, buf, len, 0)) != XML_ERR_OK) {
 		xmlError *err = xmlCtxtGetLastError(js->context);
 
-		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"));
+		switch (err->level) {
+			case XML_ERR_NONE:
+				purple_debug_info("jabber", "xmlParseChunk returned info %i\n", ret);
+				break;
+			case XML_ERR_WARNING:
+				purple_debug_warning("jabber", "xmlParseChunk returned warning %i\n", ret);
+				break;
+			case XML_ERR_ERROR:
+				purple_debug_error("jabber", "xmlParseChunk returned error %i\n", ret);
+				break;
+			case XML_ERR_FATAL:
+				purple_debug_error("jabber", "xmlParseChunk returned fatal %i\n", ret);
+				purple_connection_error_reason (js->gc,
+				                                PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+				                                _("XML Parse error"));
+				break;
 		}
 	}
 }


More information about the Commits mailing list