cpw.darkrain42.xmpp.bosh: 8808ecc9: Don't fallback (under any conditions) fr...

paul at darkrain42.org paul at darkrain42.org
Tue Feb 17 22:35:46 EST 2009


-----------------------------------------------------------------
Revision: 8808ecc9353df49f85e0a292d690631c0ce895b5
Ancestor: 5019cf23f95130beae144e0f11c27820ed03b471
Author: paul at darkrain42.org
Date: 2009-02-17T04:46:04
Branch: im.pidgin.cpw.darkrain42.xmpp.bosh
URL: http://d.pidgin.im/viewmtn/revision/info/8808ecc9353df49f85e0a292d690631c0ce895b5

Modified files:
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

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).

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	b9c08f7fe2e2bcd3a0aa5127652f6db0459b0371
+++ libpurple/protocols/jabber/jabber.c	8c1e32b59238638fdcb3f2f394529624b02d83c6
@@ -821,22 +821,27 @@ jabber_login(PurpleAccount *account)
 					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);
 	}
 }
 


More information about the Commits mailing list