changeset 25678:97a4d71e0c3d

Don't fallback (under any conditions) from old-style SSL to other connections purple_ssl_connect() can return NULL under some situations, in which case we should not try to fall back to the straight connection (or SRV queries). Additionally, we also shouldn't try those at the same time we're throwing an "SSL support unavailable" error (there was no return after that error).
author Paul Aurich <paul@darkrain42.org>
date Tue, 17 Feb 2009 04:46:04 +0000
parents 7d2e85f78aec
children 9122bf747d3a
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Tue Feb 17 04:28:19 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Tue Feb 17 04:46:04 2009 +0000
@@ -821,22 +821,27 @@
 					js->certificate_CN,
 					purple_account_get_int(account, "port", 5223), jabber_login_callback_ssl,
 					jabber_ssl_connect_failure, js->gc);
+			if (!js->gsc) {
+				purple_connection_error_reason (js->gc,
+					PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
+					_("Unable to establish SSL connection"));
+			}
 		} else {
 			purple_connection_error_reason (js->gc,
 				PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
 				_("SSL support unavailable"));
 		}
+
+		return;
 	}
 
 	/* no old-ssl, so if they've specified a connect server, we'll use that, otherwise we'll
 	 * invoke the magic of SRV lookups, to figure out host and port */
-	if(!js->gsc) {
-		if(connect_server[0]) { 
-			jabber_login_connect(js, js->user->domain, connect_server, purple_account_get_int(account, "port", 5222), TRUE);
-		} else {
-			js->srv_query_data = purple_srv_resolve("xmpp-client",
-					"tcp", js->user->domain, srv_resolved_cb, js);
-		}
+	if(connect_server[0]) { 
+		jabber_login_connect(js, js->user->domain, connect_server, purple_account_get_int(account, "port", 5222), TRUE);
+	} else {
+		js->srv_query_data = purple_srv_resolve("xmpp-client",
+				"tcp", js->user->domain, srv_resolved_cb, js);
 	}
 }