diff libpurple/protocols/jabber/jabber.c @ 30604:bc0bccdbc28f

jabber: Handle a corner case better by throwing an error instead of stalling This happens if the server *has* a TXT record for _xmppconnect.$domain, but has no useful content there. Fixes #12744, #a14367.
author Paul Aurich <paul@darkrain42.org>
date Thu, 14 Oct 2010 03:12:01 +0000
parents adce8f13a749
children b07841f6cd15
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Wed Oct 13 21:20:57 2010 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Thu Oct 14 03:12:01 2010 +0000
@@ -762,18 +762,10 @@
 txt_resolved_cb(GList *responses, gpointer data)
 {
 	JabberStream *js = data;
+	gboolean found = FALSE;
 
 	js->srv_query_data = NULL;
 
-	if (responses == NULL) {
-		purple_debug_warning("jabber", "Unable to find alternative XMPP connection "
-				  "methods after failing to connect directly.\n");
-		purple_connection_error_reason(js->gc,
-				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
-				_("Unable to connect"));
-		return;
-	}
-
 	while (responses) {
 		PurpleTxtResponse *resp = responses->data;
 		gchar **token;
@@ -790,9 +782,17 @@
 	}
 
 	if (js->bosh) {
+		found = TRUE;
 		jabber_bosh_connection_connect(js->bosh);
-	} else {
-		purple_debug_info("jabber","Didn't find an alternative connection method.\n");
+	}
+
+	if (!found) {
+		purple_debug_warning("jabber", "Unable to find alternative XMPP connection "
+				  "methods after failing to connect directly.\n");
+		purple_connection_error_reason(js->gc,
+				PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
+				_("Unable to connect"));
+		return;
 	}
 
 	if (responses) {