diff options
-rw-r--r-- | src/core/transport/chttp2/internal.h | 3 | ||||
-rw-r--r-- | src/core/transport/chttp2/stream_lists.c | 5 | ||||
-rw-r--r-- | src/core/transport/chttp2/writing.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/core/transport/chttp2/internal.h b/src/core/transport/chttp2/internal.h index ba7dcc65a5..2d99a1ee3e 100644 --- a/src/core/transport/chttp2/internal.h +++ b/src/core/transport/chttp2/internal.h @@ -35,6 +35,7 @@ #define GRPC_INTERNAL_CORE_CHTTP2_INTERNAL_H #include <assert.h> +#include <stdbool.h> #include "src/core/iomgr/endpoint.h" #include "src/core/transport/chttp2/frame.h" @@ -567,7 +568,7 @@ void grpc_chttp2_list_add_writing_stalled_by_transport( grpc_chttp2_transport_writing *transport_writing, grpc_chttp2_stream_writing *stream_writing); void grpc_chttp2_list_flush_writing_stalled_by_transport( - grpc_chttp2_transport_writing *transport_writing); + grpc_chttp2_transport_writing *transport_writing, bool is_window_available); int grpc_chttp2_list_pop_stalled_by_transport( grpc_chttp2_transport_global *transport_global, diff --git a/src/core/transport/chttp2/stream_lists.c b/src/core/transport/chttp2/stream_lists.c index ec9c08c85c..2f31a47cb3 100644 --- a/src/core/transport/chttp2/stream_lists.c +++ b/src/core/transport/chttp2/stream_lists.c @@ -322,12 +322,13 @@ void grpc_chttp2_list_add_writing_stalled_by_transport( } void grpc_chttp2_list_flush_writing_stalled_by_transport( - grpc_chttp2_transport_writing *transport_writing) { + grpc_chttp2_transport_writing *transport_writing, + bool is_window_available) { grpc_chttp2_stream *stream; grpc_chttp2_transport *transport = TRANSPORT_FROM_WRITING(transport_writing); while (stream_list_pop(transport, &stream, GRPC_CHTTP2_LIST_WRITING_STALLED_BY_TRANSPORT)) { - if (transport_writing->outgoing_window > 0) { + if (is_window_available) { grpc_chttp2_list_add_writable_stream(&transport->global, &stream->global); } else { stream_list_add(transport, stream, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT); diff --git a/src/core/transport/chttp2/writing.c b/src/core/transport/chttp2/writing.c index 455be78889..669fae8b84 100644 --- a/src/core/transport/chttp2/writing.c +++ b/src/core/transport/chttp2/writing.c @@ -329,8 +329,10 @@ void grpc_chttp2_cleanup_writing( grpc_chttp2_transport_writing *transport_writing) { grpc_chttp2_stream_writing *stream_writing; grpc_chttp2_stream_global *stream_global; + bool is_window_available = transport_writing->outgoing_window > 0; - grpc_chttp2_list_flush_writing_stalled_by_transport(transport_writing); + grpc_chttp2_list_flush_writing_stalled_by_transport(transport_writing, + is_window_available); while (grpc_chttp2_list_pop_written_stream( transport_global, transport_writing, &stream_global, &stream_writing)) { |