[glib-networking/wip/nacho/fix-libsoup-loop: 2/3] openssl: fix write loop in libsoup



commit 3f53872d642e3d494519927cbf35c6a860a209d5
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Fri Mar 13 10:43:39 2020 +0100

    openssl: fix write loop in libsoup
    
    if we get a disconnection and we get broken pipe we
    should treat it as an error. Otherwise if we pop up that it
    is not an error and we return 0 written bytes we might
    endup with a retry from the caller and endup with a write / read
    loop.

 tls/openssl/gtlsconnection-openssl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index d751344..fe77300 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -125,8 +125,7 @@ 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) ||
-       g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_BROKEN_PIPE)))
+      (priv->shutting_down && (!my_error || g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_BROKEN_PIPE))))
     {
       g_clear_error (&my_error);
       return G_TLS_CONNECTION_BASE_OK;


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