[glib-networking] gnutls: add closure-related fields to TLS pollable sources
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking] gnutls: add closure-related fields to TLS pollable sources
- Date: Wed, 8 Dec 2010 15:40:29 +0000 (UTC)
commit c5666bf93b19a612b4a42be78d1a9ea429189a34
Author: Dan Winship <danw gnome org>
Date: Tue Dec 7 23:08:38 2010 +0100
gnutls: add closure-related fields to TLS pollable sources
This brings in glib-genmarshal...
.gitignore | 1 +
configure.ac | 5 +----
proxy/libproxy/Makefile.am | 4 ++--
tls/gnutls/Makefile.am | 27 +++++++++++++++++++++++++--
tls/gnutls/gnutls-marshal.list | 1 +
tls/gnutls/gtlsconnection-gnutls.c | 29 ++++++++++++++++++++++++++++-
6 files changed, 58 insertions(+), 9 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 725eca7..ed6e2f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@ Makefile
*.o
*.lo
*.la
+*-marshal.[ch]
# autofoo stuff here
config.*
diff --git a/configure.ac b/configure.ac
index 2617595..45ab851 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,10 +32,7 @@ AM_GLIB_GNU_GETTEXT
dnl *****************************
dnl *** Check GLib GIO ***
dnl *****************************
-
-PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.27.4])
-AC_SUBST(GIO_CFLAGS)
-AC_SUBST(GIO_LIBS)
+AM_PATH_GLIB_2_0(2.27.4,,,gio)
GIO_MODULE_DIR=$($PKG_CONFIG --variable giomoduledir gio-2.0)
AS_IF([test "x$GIO_MODULE_DIR" = "x"],
diff --git a/proxy/libproxy/Makefile.am b/proxy/libproxy/Makefile.am
index dbd9ba0..e0d9ef8 100644
--- a/proxy/libproxy/Makefile.am
+++ b/proxy/libproxy/Makefile.am
@@ -15,13 +15,13 @@ libgiolibproxy_la_SOURCES = \
libgiolibproxy_la_CFLAGS = \
-DG_LOG_DOMAIN=\"GLib-Net\" \
- $(GIO_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(LIBPROXY_CFLAGS) \
-DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \
-DG_DISABLE_DEPRECATED
libgiolibproxy_la_LDFLAGS = $(module_flags)
libgiolibproxy_la_LIBADD = \
- $(GIO_LIBS) \
+ $(GLIB_LIBS) \
$(LIBPROXY_LIBS) \
$(NULL)
diff --git a/tls/gnutls/Makefile.am b/tls/gnutls/Makefile.am
index 4d2824b..a206b08 100644
--- a/tls/gnutls/Makefile.am
+++ b/tls/gnutls/Makefile.am
@@ -7,8 +7,19 @@ module_flags = -export_dynamic -avoid-version -module -no-undefined -export-symb
giomodule_LTLIBRARIES = libgiognutls.la
giomoduledir = $(GIO_MODULE_DIR)
+gnutls-marshal.h: gnutls-marshal.list
+ $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_gnutls_marshal $(srcdir)/gnutls-marshal.list --header --internal > $ tmp && \
+ mv $ tmp $@
+
+gnutls-marshal.c: gnutls-marshal.h gnutls-marshal.list
+ $(AM_V_GEN) (echo "#include \"gnutls-marshal.h\""; \
+ $(GLIB_GENMARSHAL) --prefix=_gnutls_marshal $(srcdir)/gnutls-marshal.list --body --internal) > $ tmp && \
+ mv $ tmp $@
+
libgiognutls_la_SOURCES = \
gnutls-module.c \
+ gnutls-marshal.c \
+ gnutls-marshal.h \
gtlsbackend-gnutls.c \
gtlsbackend-gnutls.h \
gtlscertificate-gnutls.c \
@@ -25,9 +36,11 @@ libgiognutls_la_SOURCES = \
gtlsserverconnection-gnutls.h \
$(NULL)
+$(libgiognutls_la_OBJECTS): gnutls-marshal.h
+
libgiognutls_la_CFLAGS = \
-DG_LOG_DOMAIN=\"GLib-Net\" \
- $(GIO_CFLAGS) \
+ $(GLIB_CFLAGS) \
$(LIBGNUTLS_CFLAGS) \
$(LIBGCRYPT_CFLAGS) \
-DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\" \
@@ -35,7 +48,17 @@ libgiognutls_la_CFLAGS = \
libgiognutls_la_LDFLAGS = $(module_flags)
libgiognutls_la_LIBADD = \
- $(GIO_LIBS) \
+ $(GLIB_LIBS) \
$(GNUTLS_LIBS) \
$(LIBGCRYPT_LIBS) \
$(NULL)
+
+BUILT_SOURCES = \
+ gnutls-marshal.h \
+ gnutls-marshal.c
+
+EXTRA_DIST = \
+ gnutls-marshal.list
+
+CLEANFILES = \
+ $(BUILT_SOURCES)
diff --git a/tls/gnutls/gnutls-marshal.list b/tls/gnutls/gnutls-marshal.list
new file mode 100644
index 0000000..22a6d67
--- /dev/null
+++ b/tls/gnutls/gnutls-marshal.list
@@ -0,0 +1 @@
+BOOL:VOID
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index f1327f2..de25e4d 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -31,6 +31,7 @@
#include "gtlsinputstream-gnutls.h"
#include "gtlsoutputstream-gnutls.h"
#include "gtlsserverconnection-gnutls.h"
+#include "gnutls-marshal.h"
#include <glib/gi18n-lib.h>
static void g_tls_connection_gnutls_get_property (GObject *object,
@@ -635,12 +636,38 @@ gnutls_source_finalize (GSource *source)
g_source_unref (gnutls_source->child_source);
}
+static gboolean
+g_tls_connection_gnutls_source_closure_callback (GObject *stream,
+ gpointer data)
+{
+ GClosure *closure = data;
+
+ GValue param = { 0, };
+ GValue result_value = { 0, };
+ gboolean result;
+
+ g_value_init (&result_value, G_TYPE_BOOLEAN);
+
+ g_value_init (¶m, G_TYPE_OBJECT);
+ g_value_set_object (¶m, stream);
+
+ g_closure_invoke (closure, &result_value, 1, ¶m, NULL);
+
+ result = g_value_get_boolean (&result_value);
+ g_value_unset (&result_value);
+ g_value_unset (¶m);
+
+ return result;
+}
+
static GSourceFuncs gnutls_source_funcs =
{
gnutls_source_prepare,
gnutls_source_check,
gnutls_source_dispatch,
- gnutls_source_finalize
+ gnutls_source_finalize,
+ (GSourceFunc)g_tls_connection_gnutls_source_closure_callback,
+ (GSourceDummyMarshal)_gnutls_marshal_BOOLEAN__VOID,
};
GSource *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]