[libsoup/carlosgc/http2-io-errors: 3/9] http2: check error/progress before session want read/write




commit f82a4dbfe07de4704928c4fc2cd1c3d222fe9ad9
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Mon Aug 29 09:19:19 2022 +0200

    http2: check error/progress before session want read/write

 libsoup/http2/soup-client-message-io-http2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index 4238d64d..a1ad1880 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -301,7 +301,7 @@ io_write_ready (GObject                  *stream,
                 return G_SOURCE_REMOVE;
         }
 
-        while (nghttp2_session_want_write (io->session) && !error)
+        while (!error && nghttp2_session_want_write (io->session))
                 io_write (io, FALSE, NULL, &error);
 
         if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) {
@@ -329,7 +329,7 @@ io_try_write (SoupClientMessageIOHTTP2 *io,
                 if (blocking || !nghttp2_session_want_write (io->session))
                         return;
         } else {
-                while (nghttp2_session_want_write (io->session) && !error)
+                while (!error && nghttp2_session_want_write (io->session))
                         io_write (io, blocking, NULL, &error);
         }
 
@@ -385,7 +385,7 @@ io_read_ready (GObject                  *stream,
         if (conn)
                 soup_connection_set_in_use (conn, TRUE);
 
-        while (nghttp2_session_want_read (io->session) && progress) {
+        while (progress && nghttp2_session_want_read (io->session)) {
                 progress = io_read (io, FALSE, NULL, &error);
                 if (progress) {
                         g_list_foreach (io->pending_io_messages,


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