pidgin: 874e9c99: We've already checked for the existance ...

markdoliner at pidgin.im markdoliner at pidgin.im
Thu Jun 17 17:11:05 EDT 2010


-----------------------------------------------------------------
Revision: 874e9c9941d0587cc9a12f70910987a514f1cee3
Ancestor: 3f1be4e68646e1b8b8d32c50d6a1ec4b2be9b7d6
Author: markdoliner at pidgin.im
Date: 2010-06-17T21:04:40
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/874e9c9941d0587cc9a12f70910987a514f1cee3

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

ChangeLog: 

We've already checked for the existance of the starttls node, so we know
it's gonna be there, so we don't need to check again

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	8f43fd5f70bf5bcfc48893ee9f27302fa9da97a2
+++ libpurple/protocols/jabber/jabber.c	cf194fc66f579908ead131e17041021b586f6755
@@ -218,22 +218,25 @@ jabber_process_starttls(JabberStream *js
 
 	account = purple_connection_get_account(js->gc);
 
-	if((starttls = xmlnode_get_child(packet, "starttls"))) {
-		if(purple_ssl_is_supported()) {
-			jabber_send_raw(js,
-					"<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1);
-			return TRUE;
-		} else if(xmlnode_get_child(starttls, "required")) {
-			purple_connection_error_reason(js->gc,
+	if(purple_ssl_is_supported()) {
+		jabber_send_raw(js,
+				"<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1);
+		return TRUE;
+	}
+
+	starttls = xmlnode_get_child(packet, "starttls");
+	if(xmlnode_get_child(starttls, "required")) {
+		purple_connection_error_reason(js->gc,
 				PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
 				_("Server requires TLS/SSL, but no TLS/SSL support was found."));
-			return TRUE;
-		} else if(purple_account_get_bool(account, "require_tls", JABBER_DEFAULT_REQUIRE_TLS)) {
-			purple_connection_error_reason(js->gc,
-				 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
+		return TRUE;
+	}
+
+	if(purple_account_get_bool(account, "require_tls", JABBER_DEFAULT_REQUIRE_TLS)) {
+		purple_connection_error_reason(js->gc,
+				PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT,
 				_("You require encryption, but no TLS/SSL support was found."));
-			return TRUE;
-		}
+		return TRUE;
 	}
 
 	return FALSE;


More information about the Commits mailing list