pidgin: f7f32911: jabber: Backward compatibility in case a...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Tue Mar 9 20:06:19 EST 2010


-----------------------------------------------------------------
Revision: f7f329117cfc3862d995cfe6dd21f3bd3b4f2d60
Ancestor: 1e788884681d69417de33d28d010a08ffa88bd9d
Author: darkrain42 at pidgin.im
Date: 2010-03-09T23:11:46
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f7f329117cfc3862d995cfe6dd21f3bd3b4f2d60

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

ChangeLog: 

jabber: Backward compatibility in case any servers advertise other random 0.## versions

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/parser.c	6a1e8e4083ad4c58c7ef6e06e502eefa9c0e22b0
+++ libpurple/protocols/jabber/parser.c	3f2b2a4807f38aa799026e2a410929d8fcfd2f9a
@@ -55,7 +55,6 @@ jabber_parser_element_start_libxml(void 
 
 				js->protocol_version.major = atoi(attrib);
 				js->protocol_version.minor = dot ? atoi(dot + 1) : 0;
-				g_free(attrib);
 
 				/* TODO: Check this against the spec; I'm not sure if the check
 				 * against minor is accurate.
@@ -64,6 +63,12 @@ jabber_parser_element_start_libxml(void 
 					purple_connection_error_reason(js->gc,
 							PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE,
 							_("XMPP Version Mismatch"));
+
+				if (js->protocol_version.major == 0 && js->protocol_version.minor != 9) {
+					purple_debug_warning("jabber", "Treating version %s as 0.9 for backward "
+					                     "compatibility\n", attrib);
+				}
+				g_free(attrib);
 			} else if(!xmlStrcmp(attributes[i], (xmlChar*) "id")) {
 				g_free(js->stream_id);
 				js->stream_id = attrib;


More information about the Commits mailing list