[glib-networking/mcatanzaro/tls-thread: 7/19] progress?



commit e1eb1c750189f0742468e1c5a9f6916d15b07639
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Jul 26 14:22:16 2019 -0500

    progress?

 tls/base/gtlsconnection-base.h       | 1 -
 tls/base/gtlsthread.c                | 6 +++---
 tls/gnutls/gtlsconnection-gnutls.c   | 3 +--
 tls/openssl/gtlsconnection-openssl.c | 3 +--
 4 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/tls/base/gtlsconnection-base.h b/tls/base/gtlsconnection-base.h
index 365e711..1527119 100644
--- a/tls/base/gtlsconnection-base.h
+++ b/tls/base/gtlsconnection-base.h
@@ -95,7 +95,6 @@ struct _GTlsConnectionBaseClass
   GTlsConnectionBaseStatus    (*read_fn)                    (GTlsConnectionBase   *tls,
                                                              void                 *buffer,
                                                              gsize                 size,
-                                                             gint64                timeout,
                                                              gssize               *nread,
                                                              GCancellable         *cancellable,
                                                              GError              **error);
diff --git a/tls/base/gtlsthread.c b/tls/base/gtlsthread.c
index 94a4b4d..e92788f 100644
--- a/tls/base/gtlsthread.c
+++ b/tls/base/gtlsthread.c
@@ -190,10 +190,9 @@ tls_thread (gpointer data)
       switch (op->type)
         {
         case G_TLS_THREAD_OP_READ:
-          /* FIXME: this is not async when timeout != 0 */
+          /* FIXME: do something with op->timeout */
           op->result = G_TLS_CONNECTION_BASE_GET_CLASS (op->connection)->read_fn (op->connection,
                                                                                   op->data, op->size,
-                                                                                  op->timeout,
                                                                                   &op->count,
                                                                                   op->cancellable,
                                                                                   &op->error);
@@ -252,7 +251,8 @@ g_tls_thread_set_property (GObject      *object,
        * as a sanity-check and debugging aid, to ensure self->connection
        * isn't ever dangling.
        */
-      g_object_add_weak_pointer (G_OBJECT (self->connection), (gpointer *)&self->connection);
+      g_object_add_weak_pointer (G_OBJECT (self->connection),
+                                 (gpointer *)&self->connection);
       break;
 
     default:
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index 7cd4e0c..9ce1d2c 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -925,7 +925,6 @@ static GTlsConnectionBaseStatus
 g_tls_connection_gnutls_read (GTlsConnectionBase  *tls,
                               void                *buffer,
                               gsize                size,
-                              gint64               timeout,
                               gssize              *nread,
                               GCancellable        *cancellable,
                               GError             **error)
@@ -935,7 +934,7 @@ g_tls_connection_gnutls_read (GTlsConnectionBase  *tls,
   GTlsConnectionBaseStatus status;
   gssize ret;
 
-  BEGIN_GNUTLS_IO (gnutls, G_IO_IN, timeout, cancellable);
+  BEGIN_GNUTLS_IO (gnutls, G_IO_IN, 0, cancellable);
   ret = gnutls_record_recv (priv->session, buffer, size);
   END_GNUTLS_IO (gnutls, G_IO_IN, ret, status, _("Error reading data from TLS socket"), error);
 
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index 331c3cf..b8d75ec 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -393,7 +393,6 @@ static GTlsConnectionBaseStatus
 g_tls_connection_openssl_read (GTlsConnectionBase    *tls,
                                void                  *buffer,
                                gsize                  size,
-                               gint64                 timeout,
                                gssize                *nread,
                                GCancellable          *cancellable,
                                GError               **error)
@@ -422,7 +421,7 @@ g_tls_connection_openssl_read (GTlsConnectionBase    *tls,
       ret = SSL_read (ssl, buffer, size);
 
       ERR_error_string_n (SSL_get_error (ssl, ret), error_str, sizeof (error_str));
-      status = end_openssl_io (openssl, G_IO_IN, ret, timeout == -1, error,
+      status = end_openssl_io (openssl, G_IO_IN, ret, FALSE, error,
                                _("Error reading data from TLS socket"), error_str);
 
       if (status != G_TLS_CONNECTION_BASE_TRY_AGAIN)


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