[libsoup] http2-io: explicitly call check_status when switching to STATE_READ_DATA on stream end



commit d450f5e46a39151bda46cbad728d9edc6c266f0b
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Thu Jun 10 05:54:30 2021 +0200

    http2-io: explicitly call check_status when switching to STATE_READ_DATA on stream end
    
    Also make sure we only call check_status for async requests.

 libsoup/http2/soup-client-message-io-http2.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index ef3ac8da..fe22f2fc 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -655,8 +655,11 @@ on_frame_recv_callback (nghttp2_session     *session,
                         data->metrics->response_body_bytes_received += frame->data.hd.length + 
FRAME_HEADER_SIZE;
                 if (frame->hd.flags & NGHTTP2_FLAG_END_STREAM && data->body_istream) {
                         soup_body_input_stream_http2_complete (SOUP_BODY_INPUT_STREAM_HTTP2 
(data->body_istream));
-                        if (data->state == STATE_READ_DATA_START)
+                        if (data->state == STATE_READ_DATA_START) {
                                 io_try_sniff_content (data, FALSE, data->item->cancellable);
+                                if (data->state == STATE_READ_DATA && data->item->async)
+                                        soup_http2_message_data_check_status (data);
+                        }
                 }
                 break;
         case NGHTTP2_RST_STREAM:
@@ -1279,7 +1282,8 @@ soup_client_message_io_http2_unpause (SoupClientMessageIO *iface,
 
         data->paused = FALSE;
 
-        soup_http2_message_data_check_status (data);
+        if (data->item->async)
+                soup_http2_message_data_check_status (data);
 }
 
 static void


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