changeset 25194:b78c8ab5de2b

Jabber BOSH: Try to continue with no BOSH version attribute Punjab doesn't return a version attribute, so try to continue w/o one...
author Paul Aurich <paul@darkrain42.org>
date Sun, 18 Jan 2009 04:11:15 +0000
parents e7f20c859519
children 4e624cc0c4a5
files libpurple/protocols/jabber/bosh.c
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/bosh.c	Sun Jan 18 04:02:31 2009 +0000
+++ b/libpurple/protocols/jabber/bosh.c	Sun Jan 18 04:11:15 2009 +0000
@@ -320,6 +320,7 @@
 
 static void boot_response_cb(PurpleBOSHConnection *conn, xmlnode *node) {
 	const char *sid, *version;
+	xmlnode *packet;
 
 	g_return_if_fail(node != NULL);
 	if (jabber_bosh_connection_error_check(conn, node))
@@ -344,20 +345,21 @@
 
 		purple_debug_info("jabber", "BOSH connection manager version %s\n", version);
 
-		/* TODO: Are major increments incompatible? */
-		if (major > 1 || (major == 1 && minor >= 6)) {
-			xmlnode *packet = xmlnode_get_child(node, "features");
-			conn->js->use_bosh = TRUE;
-			conn->receive_cb = auth_response_cb;
-			jabber_stream_features_parse(conn->js, packet);		
-		} else {
+		if (major != 1 || minor < 6) {
 			purple_connection_error_reason(conn->js->gc,
 			        PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			        _("Unsupported version of BOSH protocol"));
+			return;
 		}
 	} else {
 		purple_debug_info("jabber", "Missing version in BOSH initiation\n");
 	}
+
+	/* FIXME: Depending on receiving features might break with some hosts */
+	packet = xmlnode_get_child(node, "features");
+	conn->js->use_bosh = TRUE;
+	conn->receive_cb = auth_response_cb;
+	jabber_stream_features_parse(conn->js, packet);		
 }
 
 static void jabber_bosh_connection_boot(PurpleBOSHConnection *conn) {