[libsoup] io-http2: do not call io_read on is_open



commit 3f25abbf3859b5aaf7c3d81f6a89e8b655685a8b
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Wed May 19 14:57:22 2021 +0200

    io-http2: do not call io_read on is_open
    
    It seems to be problematic to read from there and I don't think it's
    really needed.

 libsoup/http2/soup-client-message-io-http2.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
---
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index 6196cf9c..aa7eec17 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -1288,25 +1288,8 @@ static gboolean
 soup_client_message_io_http2_is_open (SoupClientMessageIO *iface)
 {
         SoupClientMessageIOHTTP2 *io = (SoupClientMessageIOHTTP2 *)iface;
-        gboolean ret = TRUE;
 
-        /* Check directly if the session is closed */
-        if (!nghttp2_session_want_read (io->session) && !nghttp2_session_want_write (io->session))
-                ret = FALSE;
-        else {
-                /* Otherwise test if reading from the socket fails */
-                GError *error = NULL;
-                if (!io_read (io, FALSE, NULL, &error)) {
-                        if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
-                                ret = FALSE;
-
-                        g_clear_error (&error);
-                }
-        }
-
-        h2_debug (io, NULL, "[SESSION] Open=%d", ret);
-
-        return ret;
+        return nghttp2_session_want_read (io->session) || nghttp2_session_want_write (io->session);
 }
 
 static void


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