[libsoup/carlosgc/http2-io-errors: 5/8] http2: set the IO error for sync requests too




commit be1a70489e314edb3a11ba92e2505733755239a0
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Mon Aug 29 11:35:02 2022 +0200

    http2: set the IO error for sync requests too

 libsoup/http2/soup-client-message-io-http2.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index c5407bbe..849a9843 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -1566,11 +1566,13 @@ io_run_until (SoupClientMessageIOHTTP2 *io,
                 progress = io_run (data, cancellable, &my_error);
 
         if (my_error) {
-                g_propagate_error (error, my_error);
-                g_object_unref (msg);
-                return FALSE;
+                io->is_shutdown = TRUE;
+                set_io_error (io, my_error);
         }
 
+        if (io->error && !data->error)
+                data->error = g_error_copy (io->error);
+
        if (data->error) {
                 g_propagate_error (error, g_steal_pointer (&data->error));
                g_object_unref (msg);
@@ -1707,7 +1709,7 @@ soup_client_message_io_http2_close_async (SoupClientMessageIO *iface,
 
         soup_client_message_io_http2_terminate_session (io);
         if (!io->async) {
-                g_assert (io->goaway_sent);
+                g_assert (io->goaway_sent || io->error);
                 return FALSE;
         }
 


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