[glib-networking/mcatanzaro/#88] base: always finish_handshake() before clearing handshake context



commit 3d5004f76e0be79d0fed9d95385203b611750e9c
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri May 24 11:08:51 2019 -0500

    base: always finish_handshake() before clearing handshake context
    
    When we do an explicit sync handshake, we clear the handshake context
    too soon. I broke this by reordering it when moving the code from
    GTlsConnectionGnutls to GTlsConnectionBase.
    
    Fixes #88

 tls/base/gtlsconnection-base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tls/base/gtlsconnection-base.c b/tls/base/gtlsconnection-base.c
index b75e522..4c24253 100644
--- a/tls/base/gtlsconnection-base.c
+++ b/tls/base/gtlsconnection-base.c
@@ -1531,12 +1531,12 @@ g_tls_connection_base_handshake (GTlsConnection   *conn,
   g_task_run_in_thread (task, handshake_thread);
   crank_sync_handshake_context (tls, cancellable);
 
-  g_main_context_pop_thread_default (priv->handshake_context);
-  g_clear_pointer (&priv->handshake_context, g_main_context_unref);
-
   success = finish_handshake (tls, task, &my_error);
   g_object_unref (task);
 
+  g_main_context_pop_thread_default (priv->handshake_context);
+  g_clear_pointer (&priv->handshake_context, g_main_context_unref);
+
   yield_op (tls, G_TLS_CONNECTION_BASE_OP_HANDSHAKE,
             G_TLS_CONNECTION_BASE_OK);
 


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