[glib-networking/mcatanzaro/tls-thread: 9/14] progress
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/tls-thread: 9/14] progress
- Date: Sat, 14 Dec 2019 20:22:37 +0000 (UTC)
commit 6eb8648e2ee11d657f498c2d908bb2ffdd04f40f
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Dec 4 16:04:59 2019 -0600
progress
tls/base/gtlsconnection-base.c | 13 +++++--------
tls/gnutls/gtlsconnection-gnutls.c | 6 +++++-
tls/openssl/gtlsconnection-openssl.c | 6 +++++-
3 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/tls/base/gtlsconnection-base.c b/tls/base/gtlsconnection-base.c
index ef70122..d9f8c4b 100644
--- a/tls/base/gtlsconnection-base.c
+++ b/tls/base/gtlsconnection-base.c
@@ -168,6 +168,8 @@ static void g_tls_connection_base_dtls_connection_iface_init (GDtlsConnectionInt
static void g_tls_connection_base_datagram_based_iface_init (GDatagramBasedInterface *iface);
+static void g_tls_connection_base_initable_iface_init (GInitableIface *iface);
+
static gboolean do_implicit_handshake (GTlsConnectionBase *tls,
gint64 timeout,
GCancellable *cancellable,
@@ -187,14 +189,14 @@ static gboolean g_tls_connection_base_handshake (GTlsConnection *conn,
GCancellable *cancellable,
GError **error);
-static GInitableIface *g_tls_connection_base_parent_initable_iface;
-
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GTlsConnectionBase, g_tls_connection_base, G_TYPE_TLS_CONNECTION,
G_ADD_PRIVATE (GTlsConnectionBase);
G_IMPLEMENT_INTERFACE (G_TYPE_DATAGRAM_BASED,
g_tls_connection_base_datagram_based_iface_init);
G_IMPLEMENT_INTERFACE (G_TYPE_DTLS_CONNECTION,
g_tls_connection_base_dtls_connection_iface_init);
+ G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
+ g_tls_connection_base_initable_iface_init);
);
@@ -252,9 +254,6 @@ g_tls_connection_base_initable_init (GInitable *initable,
priv->thread = G_TLS_CONNECTION_BASE_GET_CLASS (tls)->create_op_thread (tls);
- if (!g_tls_connection_base_parent_initable_iface->init (initable, cancellable, error))
- return FALSE;
-
return TRUE;
}
@@ -2752,9 +2751,7 @@ g_tls_connection_base_datagram_based_iface_init (GDatagramBasedInterface *iface)
}
static void
-g_tls_client_connection_base_initable_interface_init (GInitableIface *iface)
+g_tls_connection_base_initable_iface_init (GInitableIface *iface)
{
- g_tls_connection_base_parent_initable_iface = g_type_interface_peek_parent (iface);
-
iface->init = g_tls_connection_base_initable_init;
}
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index 4852aec..16ecbc4 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -65,6 +65,8 @@ static ssize_t g_tls_connection_gnutls_pull_func (gnutls_transport_ptr_t transp
static int g_tls_connection_gnutls_pull_timeout_func (gnutls_transport_ptr_t transport_data,
unsigned int ms);
+static GInitableIface *g_tls_connection_gnutls_parent_initable_iface;
+
static void g_tls_connection_gnutls_initable_iface_init (GInitableIface *iface);
static int verify_certificate_cb (gnutls_session_t session);
@@ -176,7 +178,7 @@ g_tls_connection_gnutls_initable_init (GInitable *initable,
if (flags & GNUTLS_DATAGRAM)
gnutls_dtls_set_mtu (priv->session, 1400);
- return TRUE;
+ return g_tls_connection_gnutls_parent_initable_iface->init (initable, cancellable, error);
}
static void
@@ -991,5 +993,7 @@ g_tls_connection_gnutls_class_init (GTlsConnectionGnutlsClass *klass)
static void
g_tls_connection_gnutls_initable_iface_init (GInitableIface *iface)
{
+ g_tls_connection_gnutls_parent_initable_iface = g_type_interface_peek_parent (iface);
+
iface->init = g_tls_connection_gnutls_initable_init;
}
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index d356433..af85e45 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -46,6 +46,8 @@ typedef struct _GTlsConnectionOpensslPrivate
gboolean shutting_down;
} GTlsConnectionOpensslPrivate;
+static GInitableIface *g_tls_connection_openssl_parent_initable_iface;
+
static void g_tls_connection_openssl_initable_iface_init (GInitableIface *iface);
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GTlsConnectionOpenssl, g_tls_connection_openssl,
G_TYPE_TLS_CONNECTION_BASE,
@@ -446,12 +448,14 @@ g_tls_connection_openssl_initable_init (GInitable *initable,
SSL_set_bio (ssl, priv->bio, priv->bio);
- return TRUE;
+ return g_tls_connection_openssl_parent_initable_iface->init (initable, cancellable, error);
}
static void
g_tls_connection_openssl_initable_iface_init (GInitableIface *iface)
{
+ g_tls_connection_openssl_parent_initable_iface = g_type_interface_peek_parent (iface);
+
iface->init = g_tls_connection_openssl_initable_init;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]