[glib/wip/danw/clicert: 3/3] fixup! Add a request_certificate virtual method to GTlsInteraction



commit 78a48a900b56c7523bdf6250849c2be691f8662a
Author: Dan Winship <danw gnome org>
Date:   Sat Oct 19 11:49:56 2013 -0400

    fixup! Add a request_certificate virtual method to GTlsInteraction

 docs/reference/gio/gio-sections.txt |    1 +
 gio/gioenums.h                      |   14 +++++++
 gio/gtlsinteraction.c               |   34 +++++++++--------
 gio/gtlsinteraction.h               |   70 +++++++++++++++++-----------------
 4 files changed, 68 insertions(+), 51 deletions(-)
---
diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt
index d7638ca..1ef0082 100644
--- a/docs/reference/gio/gio-sections.txt
+++ b/docs/reference/gio/gio-sections.txt
@@ -3551,6 +3551,7 @@ G_TYPE_TLS_PASSWORD_FLAGS
 <TITLE>GTlsInteraction</TITLE>
 GTlsInteraction
 GTlsInteractionResult
+GTlsCertificateRequestFlags
 g_tls_interaction_invoke_ask_password
 g_tls_interaction_invoke_request_certificate
 g_tls_interaction_ask_password
diff --git a/gio/gioenums.h b/gio/gioenums.h
index b8b8ec6..98273cf 100644
--- a/gio/gioenums.h
+++ b/gio/gioenums.h
@@ -1631,6 +1631,20 @@ typedef enum {
 } GTlsDatabaseLookupFlags;
 
 /**
+ * GTlsCertificateRequestFlags:
+ * @G_TLS_CERTIFICATE_REQUEST_NONE: No flags
+ *
+ * Flags for g_tls_interaction_request_certificate(),
+ * g_tls_interaction_request_certificate_async(), and
+ * g_tls_interaction_invoke_request_certificate().
+ *
+ * Since: 2.40
+ */
+typedef enum {
+  G_TLS_CERTIFICATE_REQUEST_NONE = 0
+} GTlsCertificateRequestFlags;
+
+/**
  * GIOModuleScopeFlags:
  * @G_IO_MODULE_SCOPE_NONE: No module scan flags
  * @G_IO_MODULE_SCOPE_BLOCK_DUPLICATES: When using this scope to load or
diff --git a/gio/gtlsinteraction.c b/gio/gtlsinteraction.c
index 45c36f5..8059dc3 100644
--- a/gio/gtlsinteraction.c
+++ b/gio/gtlsinteraction.c
@@ -620,7 +620,7 @@ on_invoke_request_certificate_async_as_sync (gpointer user_data)
  * g_tls_interaction_invoke_request_certificate:
  * @interaction: a #GTlsInteraction object
  * @connection: a #GTlsConnection object
- * @unused_flags: FIXME
+ * @flags: flags providing more information about the request
  * @cancellable: an optional #GCancellable cancellation object
  * @error: an optional location to place an error on failure
  *
@@ -651,8 +651,8 @@ on_invoke_request_certificate_async_as_sync (gpointer user_data)
  */
 GTlsInteractionResult
 g_tls_interaction_invoke_request_certificate (GTlsInteraction    *interaction,
-                                              GTlsConnection     *connection,
-                                              gint                unused_flags,
+                                              GTlsConnection               *connection,
+                                              GTlsCertificateRequestFlags   flags,
                                               GCancellable       *cancellable,
                                               GError            **error)
 {
@@ -694,6 +694,7 @@ g_tls_interaction_invoke_request_certificate (GTlsInteraction    *interaction,
  * g_tls_interaction_request_certificate:
  * @interaction: a #GTlsInteraction object
  * @connection: a #GTlsConnection object
+ * @flags: flags providing more information about the request
  * @cancellable: an optional #GCancellable cancellation object
  * @error: an optional location to place an error on failure
  *
@@ -719,11 +720,11 @@ g_tls_interaction_invoke_request_certificate (GTlsInteraction    *interaction,
  * Since: 2.40
  */
 GTlsInteractionResult
-g_tls_interaction_request_certificate (GTlsInteraction    *interaction,
-                                       GTlsConnection     *connection,
-                                       gint                unused_flags,
-                                       GCancellable       *cancellable,
-                                       GError            **error)
+g_tls_interaction_request_certificate (GTlsInteraction              *interaction,
+                                       GTlsConnection               *connection,
+                                       GTlsCertificateRequestFlags   flags,
+                                       GCancellable                 *cancellable,
+                                       GError                      **error)
 {
   GTlsInteractionClass *klass;
 
@@ -733,7 +734,7 @@ g_tls_interaction_request_certificate (GTlsInteraction    *interaction,
 
   klass = G_TLS_INTERACTION_GET_CLASS (interaction);
   if (klass->request_certificate)
-    return (klass->request_certificate) (interaction, connection, unused_flags, cancellable, error);
+    return (klass->request_certificate) (interaction, connection, flags, cancellable, error);
   else
     return G_TLS_INTERACTION_UNHANDLED;
 }
@@ -742,6 +743,7 @@ g_tls_interaction_request_certificate (GTlsInteraction    *interaction,
  * g_tls_interaction_request_certificate_async:
  * @interaction: a #GTlsInteraction object
  * @connection: a #GTlsConnection object
+ * @flags: flags providing more information about the request
  * @cancellable: an optional #GCancellable cancellation object
  * @callback: (allow-none): will be called when the interaction completes
  * @user_data: (allow-none): data to pass to the @callback
@@ -758,12 +760,12 @@ g_tls_interaction_request_certificate (GTlsInteraction    *interaction,
  * Since: 2.40
  */
 void
-g_tls_interaction_request_certificate_async (GTlsInteraction    *interaction,
-                                             GTlsConnection     *connection,
-                                             gint                unused_flags,
-                                             GCancellable       *cancellable,
-                                             GAsyncReadyCallback callback,
-                                             gpointer            user_data)
+g_tls_interaction_request_certificate_async (GTlsInteraction              *interaction,
+                                             GTlsConnection               *connection,
+                                             GTlsCertificateRequestFlags   flags,
+                                             GCancellable                 *cancellable,
+                                             GAsyncReadyCallback           callback,
+                                             gpointer                      user_data)
 {
   GTlsInteractionClass *klass;
   GTask *task;
@@ -776,7 +778,7 @@ g_tls_interaction_request_certificate_async (GTlsInteraction    *interaction,
   if (klass->request_certificate_async)
     {
       g_return_if_fail (klass->request_certificate_finish);
-      (klass->request_certificate_async) (interaction, connection, unused_flags,
+      (klass->request_certificate_async) (interaction, connection, flags,
                                           cancellable, callback, user_data);
     }
   else
diff --git a/gio/gtlsinteraction.h b/gio/gtlsinteraction.h
index ee337bb..bb3df32 100644
--- a/gio/gtlsinteraction.h
+++ b/gio/gtlsinteraction.h
@@ -69,22 +69,22 @@ struct _GTlsInteractionClass
                                                   GAsyncResult       *result,
                                                   GError            **error);
 
-  GTlsInteractionResult  (* request_certificate)        (GTlsInteraction    *interaction,
-                                                         GTlsConnection     *connection,
-                                                         gint                unused_flags,
-                                                         GCancellable       *cancellable,
-                                                         GError            **error);
-
-  void                   (* request_certificate_async)  (GTlsInteraction    *interaction,
-                                                         GTlsConnection     *connection,
-                                                         gint                unused_flags,
-                                                         GCancellable       *cancellable,
-                                                         GAsyncReadyCallback callback,
-                                                         gpointer            user_data);
-
-  GTlsInteractionResult  (* request_certificate_finish) (GTlsInteraction    *interaction,
-                                                         GAsyncResult       *result,
-                                                         GError            **error);
+  GTlsInteractionResult  (* request_certificate)        (GTlsInteraction              *interaction,
+                                                         GTlsConnection               *connection,
+                                                         GTlsCertificateRequestFlags   flags,
+                                                         GCancellable                 *cancellable,
+                                                         GError                      **error);
+
+  void                   (* request_certificate_async)  (GTlsInteraction              *interaction,
+                                                         GTlsConnection               *connection,
+                                                         GTlsCertificateRequestFlags   flags,
+                                                         GCancellable                 *cancellable,
+                                                         GAsyncReadyCallback           callback,
+                                                         gpointer                      user_data);
+
+  GTlsInteractionResult  (* request_certificate_finish) (GTlsInteraction              *interaction,
+                                                         GAsyncResult                 *result,
+                                                         GError                      **error);
 
   /*< private >*/
   /* Padding for future expansion */
@@ -119,31 +119,31 @@ GTlsInteractionResult  g_tls_interaction_ask_password_finish (GTlsInteraction
                                                               GError            **error);
 
 GLIB_AVAILABLE_IN_2_40
-GTlsInteractionResult  g_tls_interaction_invoke_request_certificate (GTlsInteraction    *interaction,
-                                                                     GTlsConnection     *connection,
-                                                                     gint                unused_flags,
-                                                                     GCancellable       *cancellable,
-                                                                     GError            **error);
+GTlsInteractionResult  g_tls_interaction_invoke_request_certificate (GTlsInteraction              
*interaction,
+                                                                     GTlsConnection               
*connection,
+                                                                     GTlsCertificateRequestFlags   flags,
+                                                                     GCancellable                 
*cancellable,
+                                                                     GError                      **error);
 
 GLIB_AVAILABLE_IN_2_40
-GTlsInteractionResult  g_tls_interaction_request_certificate        (GTlsInteraction    *interaction,
-                                                                     GTlsConnection     *connection,
-                                                                     gint                unused_flags,
-                                                                     GCancellable       *cancellable,
-                                                                     GError            **error);
+GTlsInteractionResult  g_tls_interaction_request_certificate        (GTlsInteraction              
*interaction,
+                                                                     GTlsConnection               
*connection,
+                                                                     GTlsCertificateRequestFlags   flags,
+                                                                     GCancellable                 
*cancellable,
+                                                                     GError                      **error);
 
 GLIB_AVAILABLE_IN_2_40
-void                   g_tls_interaction_request_certificate_async  (GTlsInteraction    *interaction,
-                                                                     GTlsConnection     *connection,
-                                                                     gint                unused_flags,
-                                                                     GCancellable       *cancellable,
-                                                                     GAsyncReadyCallback callback,
-                                                                     gpointer            user_data);
+void                   g_tls_interaction_request_certificate_async  (GTlsInteraction              
*interaction,
+                                                                     GTlsConnection               
*connection,
+                                                                     GTlsCertificateRequestFlags   flags,
+                                                                     GCancellable                 
*cancellable,
+                                                                     GAsyncReadyCallback           callback,
+                                                                     gpointer                      
user_data);
 
 GLIB_AVAILABLE_IN_2_40
-GTlsInteractionResult  g_tls_interaction_request_certificate_finish (GTlsInteraction    *interaction,
-                                                                     GAsyncResult       *result,
-                                                                     GError            **error);
+GTlsInteractionResult  g_tls_interaction_request_certificate_finish (GTlsInteraction              
*interaction,
+                                                                     GAsyncResult                 *result,
+                                                                     GError                      **error);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]