[glib-networking/mcatanzaro/base-rebase: 46/55] openssl: fix shutdown error



commit c6cba2e91ebc7f1e57baa2d788ff37bd4a46b2c4
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Tue May 14 16:19:22 2019 +0200

    openssl: fix shutdown error
    
    With a new version of openssl when shutting down it is highly
    possible to get  G_IO_ERROR_BROKEN_PIPE when writing the openssl
    shutdown data. This is expected and we should not error out.

 tls/openssl/gtlsconnection-openssl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index 6957f84..9a5d777 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -105,7 +105,8 @@ end_openssl_io (GTlsConnectionOpenssl  *openssl,
     }
 
   /* This case is documented that it may happen and that is perfectly fine */
-  if (err_code == SSL_ERROR_SYSCALL && priv->shutting_down && !my_error)
+  if (err_code == SSL_ERROR_SYSCALL && priv->shutting_down &&
+     (!my_error || g_error_matches(my_error, G_IO_ERROR, G_IO_ERROR_BROKEN_PIPE)))
     return G_TLS_CONNECTION_BASE_OK;
 
   err = ERR_get_error ();


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