Skip to content
Snippets Groups Projects
Commit 55b1b59d authored by yang-g's avatar yang-g
Browse files

move flow control code back to writing.c

parent 897925eb
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#define GRPC_INTERNAL_CORE_CHTTP2_INTERNAL_H #define GRPC_INTERNAL_CORE_CHTTP2_INTERNAL_H
#include <assert.h> #include <assert.h>
#include <stdbool.h>
#include "src/core/iomgr/endpoint.h" #include "src/core/iomgr/endpoint.h"
#include "src/core/transport/chttp2/frame.h" #include "src/core/transport/chttp2/frame.h"
...@@ -567,7 +568,7 @@ void grpc_chttp2_list_add_writing_stalled_by_transport( ...@@ -567,7 +568,7 @@ void grpc_chttp2_list_add_writing_stalled_by_transport(
grpc_chttp2_transport_writing *transport_writing, grpc_chttp2_transport_writing *transport_writing,
grpc_chttp2_stream_writing *stream_writing); grpc_chttp2_stream_writing *stream_writing);
void grpc_chttp2_list_flush_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);
int grpc_chttp2_list_pop_stalled_by_transport( int grpc_chttp2_list_pop_stalled_by_transport(
grpc_chttp2_transport_global *transport_global, grpc_chttp2_transport_global *transport_global,
......
...@@ -322,12 +322,13 @@ void grpc_chttp2_list_add_writing_stalled_by_transport( ...@@ -322,12 +322,13 @@ void grpc_chttp2_list_add_writing_stalled_by_transport(
} }
void grpc_chttp2_list_flush_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_stream *stream;
grpc_chttp2_transport *transport = TRANSPORT_FROM_WRITING(transport_writing); grpc_chttp2_transport *transport = TRANSPORT_FROM_WRITING(transport_writing);
while (stream_list_pop(transport, &stream, while (stream_list_pop(transport, &stream,
GRPC_CHTTP2_LIST_WRITING_STALLED_BY_TRANSPORT)) { 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); grpc_chttp2_list_add_writable_stream(&transport->global, &stream->global);
} else { } else {
stream_list_add(transport, stream, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT); stream_list_add(transport, stream, GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT);
......
...@@ -329,8 +329,10 @@ void grpc_chttp2_cleanup_writing( ...@@ -329,8 +329,10 @@ void grpc_chttp2_cleanup_writing(
grpc_chttp2_transport_writing *transport_writing) { grpc_chttp2_transport_writing *transport_writing) {
grpc_chttp2_stream_writing *stream_writing; grpc_chttp2_stream_writing *stream_writing;
grpc_chttp2_stream_global *stream_global; 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( while (grpc_chttp2_list_pop_written_stream(
transport_global, transport_writing, &stream_global, &stream_writing)) { transport_global, transport_writing, &stream_global, &stream_writing)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment