/pidgin/main: 95771d0cf853: Remove unused SslOps code from sslco...

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


Changeset: 95771d0cf8534985b780b30333ed8291c9fa2649
Author:	 Mike Ruprecht <cmaiku at gmail.com>
Date:	 2016-01-31 00:52 -0600
Branch:	 purple-ssl-to-gio
URL: https://hg.pidgin.im/pidgin/main/rev/95771d0cf853

Description:

Remove unused SslOps code from sslconn.[ch]

Now that the new TLS Certificate API is being used and the plugins
that use the old SslOps are no longer around, this code can be
removed. This patch does just that.

diffstat:

 libpurple/sslconn.c |  13 ---------
 libpurple/sslconn.h |  74 -----------------------------------------------------
 2 files changed, 0 insertions(+), 87 deletions(-)

diffs (128 lines):

diff --git a/libpurple/sslconn.c b/libpurple/sslconn.c
--- a/libpurple/sslconn.c
+++ b/libpurple/sslconn.c
@@ -29,7 +29,6 @@
 #include "tls-certificate.h"
 
 static gboolean _ssl_initialized = FALSE;
-static PurpleSslOps *_ssl_ops = NULL;
 
 static gboolean
 ssl_init(void)
@@ -376,18 +375,6 @@ purple_ssl_get_peer_certificates(PurpleS
 }
 
 void
-purple_ssl_set_ops(PurpleSslOps *ops)
-{
-	_ssl_ops = ops;
-}
-
-PurpleSslOps *
-purple_ssl_get_ops(void)
-{
-	return _ssl_ops;
-}
-
-void
 purple_ssl_init(void)
 {
 	/* Although purple_ssl_is_supported will do the initialization on
diff --git a/libpurple/sslconn.h b/libpurple/sslconn.h
--- a/libpurple/sslconn.h
+++ b/libpurple/sslconn.h
@@ -46,7 +46,6 @@ typedef enum
 #define PURPLE_SSL_DEFAULT_PORT 443
 
 typedef struct _PurpleSslConnection PurpleSslConnection;
-typedef struct _PurpleSslOps PurpleSslOps;
 
 typedef void (*PurpleSslInputFunction)(gpointer, PurpleSslConnection *,
 									 PurpleInputCondition);
@@ -91,62 +90,6 @@ struct _PurpleSslConnection
 	void *private_data;
 };
 
-/**
- * PurpleSslOps:
- * @init: Initializes the SSL system provided. See purple_ssl_init().
- *        <sbr/>Returns: %TRUE if initialization succeeded
- * @uninit: Unloads the SSL system. Inverse of PurpleSslOps::init.
- *          See purple_ssl_uninit().
- * @connectfunc: Sets up the SSL connection for a #PurpleSslConnection once the
- *               TCP connection has been established. See purple_ssl_connect().
- * @close: Destroys the internal data of the SSL connection provided. Freeing
- *         @gsc itself is left to purple_ssl_close().
- * @read: Reads data from a connection (like POSIX read()).
- *        See purple_ssl_read().
- *        <sbr/>@gsc:    Connection context
- *        <sbr/>@data:   Pointer to buffer to drop data into
- *        <sbr/>@len:    Maximum number of bytes to read
- *        <sbr/>Returns: Number of bytes actually written into @data
- *                       (which may be less than @len), or <0 on error
- * @write: Writes data to a connection (like POSIX send()).
- *         See purple_ssl_write().
- *         <sbr/>@gsc:    Connection context
- *         <sbr/>@data:   Data buffer to send data from
- *         <sbr/>@len:    Number of bytes to send from buffer
- *         <sbr/>Returns: The number of bytes written to @data (may be less than
- *                        @len) or <0 on error
- * @get_peer_certificates: Obtains the certificate chain provided by the peer.
- *                         See #PurpleCertificate.
- *                         <sbr/>@gsc:    Connection context
- *                         <sbr/>Returns: A newly allocated list containing the
- *                                        certificates the peer provided.
- *
- * SSL implementation operations structure.
- *
- * Every SSL implementation must provide all of these and register it via
- * purple_ssl_set_ops().
- * These should not be called directly! Instead, use the purple_ssl_* functions.
- */
-struct _PurpleSslOps
-{
-	gboolean (*init)(void);
-	void (*uninit)(void);
-	void (*connectfunc)(PurpleSslConnection *gsc);
-	void (*close)(PurpleSslConnection *gsc);
-	size_t (*read)(PurpleSslConnection *gsc, void *data, size_t len);
-	size_t (*write)(PurpleSslConnection *gsc, const void *data, size_t len);
-
-	/* TODO Decide whether the ordering of certificates in this list can be
-	        guaranteed. */
-	GList * (* get_peer_certificates)(PurpleSslConnection * gsc);
-
-	/*< private >*/
-	void (*_purple_reserved1)(void);
-	void (*_purple_reserved2)(void);
-	void (*_purple_reserved3)(void);
-	void (*_purple_reserved4)(void);
-};
-
 G_BEGIN_DECLS
 
 /**************************************************************************/
@@ -301,23 +244,6 @@ GList * purple_ssl_get_peer_certificates
 /**************************************************************************/
 
 /**
- * purple_ssl_set_ops:
- * @ops: The SSL operations structure to assign.
- *
- * Sets the current SSL operations structure.
- */
-void purple_ssl_set_ops(PurpleSslOps *ops);
-
-/**
- * purple_ssl_get_ops:
- *
- * Returns the current SSL operations structure.
- *
- * Returns: The SSL operations structure.
- */
-PurpleSslOps *purple_ssl_get_ops(void);
-
-/**
  * purple_ssl_init:
  *
  * Initializes the SSL subsystem.



More information about the Commits mailing list