changeset 25180:1516525c86fa

Track the TXT query in the js object so it will be cancelleable
author Paul Aurich <paul@darkrain42.org>
date Mon, 01 Dec 2008 04:00:41 +0000
parents 514051f3b6cf
children 7de1f124f95a
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Mon Dec 01 04:00:41 2008 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Mon Dec 01 04:00:41 2008 +0000
@@ -576,6 +576,8 @@
 	JabberStream *js = gc->proto_data;
 	int n;
 	
+	js->srv_query_data = NULL;
+
 	if (results == 0) {
 		gchar *tmp;
 		tmp = g_strdup_printf(_("Could not find alternative XMPP connection methods after failing to connect directly.\n"));
@@ -590,7 +592,7 @@
 		token = g_strsplit(resp[n].content, "=", 2);
 		if (!strcmp(token[0], "_xmpp-client-xbosh")) {
 			purple_debug_info("jabber","Found alternative connection method using %s at %s.\n", token[0], token[1]);
-			jabber_bosh_connection_init(&(js->bosh), gc->account, js, token[1]);
+			jabber_bosh_connection_init(&(js->bosh), js->gc->account, js, token[1]);
 			g_strfreev(token);
 			break;
 		}
@@ -616,7 +618,7 @@
 			try_srv_connect(js);
 		} else {
 			purple_debug_info("jabber","Couldn't connect directly to %s. Trying to find alternative connection methods, like BOSH.\n", js->user->domain);
-			purple_txt_resolve("_xmppconnect", js->user->domain, txt_resolved_cb, gc);
+			js->srv_query_data = purple_txt_resolve("_xmppconnect", js->user->domain, txt_resolved_cb, gc);
 		}
 		return;
 	}
@@ -769,7 +771,7 @@
 
 	/* XXX FORCE_BOSH: Remove this */
 	if (force_bosh) {
-		purple_txt_resolve("_xmppconnect", js->user->domain, txt_resolved_cb, gc);
+		js->srv_query_data = purple_txt_resolve("_xmppconnect", js->user->domain, txt_resolved_cb, gc);
 		return;
 	}