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



commit 12831bb0b9b997e5f89075963d52834a74b5cb49
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]