cpw.darkrain42.xmpp.bosh: 1bfe3441: Jabber BOSH: Try to continue with no BOS...
paul at darkrain42.org
paul at darkrain42.org
Sat Jan 17 23:51:20 EST 2009
-----------------------------------------------------------------
Revision: 1bfe3441a9c9ca7e7a180babebca02b43b5c7d9b
Ancestor: fa3716f9064b0b95a2551b053ce4e4fd327f9879
Author: paul at darkrain42.org
Date: 2009-01-18T04:11:15
Branch: im.pidgin.cpw.darkrain42.xmpp.bosh
URL: http://d.pidgin.im/viewmtn/revision/info/1bfe3441a9c9ca7e7a180babebca02b43b5c7d9b
Modified files:
libpurple/protocols/jabber/bosh.c
ChangeLog:
Jabber BOSH: Try to continue with no BOSH version attribute
Punjab doesn't return a version attribute, so try to continue w/o one...
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/bosh.c 0712a233707591baf1c1743839972959b9f4e6ec
+++ libpurple/protocols/jabber/bosh.c cedaec3592a331f72168379c505228b0232660ae
@@ -320,6 +320,7 @@ static void boot_response_cb(PurpleBOSHC
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 @@ static void boot_response_cb(PurpleBOSHC
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) {
More information about the Commits
mailing list