/pidgin/main: e6ccacaa6322: sslconn: Remove purple_ssl_(init|uni...

Mike Ruprecht cmaiku at gmail.com
Thu Apr 7 13:36:21 EDT 2016


Changeset: e6ccacaa63226565ff34e6cf9a4a06a5feb854a8
Author:	 Mike Ruprecht <cmaiku at gmail.com>
Date:	 2016-04-07 02:47 -0500
Branch:	 purple-ssl-to-gio
URL: https://hg.pidgin.im/pidgin/main/rev/e6ccacaa6322

Description:

sslconn: Remove purple_ssl_(init|uninit) as they're no longer needed

This patch removes purple_ssl_init() and purple_ssl_uninit() and
dependent code as now that the SSL plugins have been removed in
favor of Gio, nothing is actually being initialized.

diffstat:

 libpurple/core.c    |   4 ----
 libpurple/sslconn.c |  39 ---------------------------------------
 2 files changed, 0 insertions(+), 43 deletions(-)

diffs (88 lines):

diff --git a/libpurple/core.c b/libpurple/core.c
--- a/libpurple/core.c
+++ b/libpurple/core.c
@@ -198,7 +198,6 @@ purple_core_init(const char *ui)
 	_purple_socket_init();
 	purple_proxy_init();
 	purple_sound_init();
-	purple_ssl_init();
 	purple_stun_init();
 	purple_xfers_init();
 	purple_idle_init();
@@ -240,9 +239,6 @@ purple_core_quit(void)
 	/* Transmission ends */
 	purple_connections_disconnect_all();
 
-	/* The SSL plugins must be uninit before they're unloaded */
-	purple_ssl_uninit();
-
 	/* Save .xml files, remove signals, etc. */
 	_purple_smiley_theme_uninit();
 	_purple_smiley_custom_uninit();
diff --git a/libpurple/sslconn.c b/libpurple/sslconn.c
--- a/libpurple/sslconn.c
+++ b/libpurple/sslconn.c
@@ -28,14 +28,6 @@
 #include "sslconn.h"
 #include "tls-certificate.h"
 
-static gboolean _ssl_initialized = FALSE;
-
-static gboolean
-ssl_init(void)
-{
-	return g_tls_backend_supports_tls(g_tls_backend_get_default());
-}
-
 static void
 emit_error(PurpleSslConnection *gsc, int error_code)
 {
@@ -161,12 +153,6 @@ purple_ssl_connect_with_ssl_cn(PurpleAcc
 	g_return_val_if_fail(port != 0 && port != -1, NULL);
 	g_return_val_if_fail(func != NULL,            NULL);
 
-	if (!_ssl_initialized)
-	{
-		if (!ssl_init())
-			return NULL;
-	}
-
 	gsc = g_new0(PurpleSslConnection, 1);
 
 	gsc->fd              = -1;
@@ -260,12 +246,6 @@ purple_ssl_connect_with_host_fd(PurpleAc
 	g_return_val_if_fail(fd != -1,                NULL);
 	g_return_val_if_fail(func != NULL,            NULL);
 
-	if (!_ssl_initialized)
-	{
-		if (!ssl_init())
-			return NULL;
-	}
-
 	gsc = g_new0(PurpleSslConnection, 1);
 
 	gsc->connect_cb_data = data;
@@ -387,22 +367,3 @@ purple_ssl_get_peer_certificates(PurpleS
 	return certificate != NULL ? g_list_append(NULL, certificate) : NULL;
 }
 
-void
-purple_ssl_init(void)
-{
-	/* Although purple_ssl_is_supported will do the initialization on
-	   command, SSL plugins tend to register CertificateSchemes as well
-	   as providing SSL ops. */
-	if (!ssl_init()) {
-		purple_debug_error("sslconn", "Unable to initialize SSL.\n");
-	}
-}
-
-void
-purple_ssl_uninit(void)
-{
-	if (!_ssl_initialized)
-		return;
-
-	_ssl_initialized = FALSE;
-}



More information about the Commits mailing list