[libsoup/carlosgc/http2-close-idle: 12/12] http2: try to write after every data frame read




commit b90cb7f408e79717c9f5ee104bb0a8ce2d673f68
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Fri Mar 11 09:53:42 2022 +0100

    http2: try to write after every data frame read
    
    The flow control is done automatically by nghttp2, window update frames
    are sent automatically, but we need to write them. So, after every data
    frame read, we should stry to write in case there's a pending window
    update.

 libsoup/http2/soup-client-message-io-http2.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/libsoup/http2/soup-client-message-io-http2.c b/libsoup/http2/soup-client-message-io-http2.c
index 78817b8a..33869caf 100644
--- a/libsoup/http2/soup-client-message-io-http2.c
+++ b/libsoup/http2/soup-client-message-io-http2.c
@@ -724,6 +724,8 @@ on_frame_recv_callback (nghttp2_session     *session,
                                         soup_http2_message_data_check_status (data);
                         }
                 }
+                /* Try to write after every data frame, since nghttp2 might need to send a window update. */
+                io_try_write (io, !data->item->async);
                 break;
         case NGHTTP2_RST_STREAM:
                 if (frame->rst_stream.error_code != NGHTTP2_NO_ERROR) {


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