diff options
author | Yang Gao <yangg@google.com> | 2015-04-28 10:30:28 -0700 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-04-28 10:30:28 -0700 |
commit | c9e39c0728da270c1bced4938ee9745aeb208890 (patch) | |
tree | 349095badba30270389f50a952c25cadc8a69a6a /src/core | |
parent | 5324c6a8b99a43726bdaffe30982828d6ce78e56 (diff) |
Fix flow control issue
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/transport/chttp2_transport.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index e32ee284e0..786d9cf6eb 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -582,16 +582,18 @@ static int init_stream(grpc_transport *gt, grpc_stream *gs, if (!server_data) { lock(t); s->id = 0; + s->outgoing_window = 0; + s->incoming_window = 0; } else { s->id = (gpr_uint32)(gpr_uintptr)server_data; + s->outgoing_window = + t->settings[PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]; + s->incoming_window = + t->settings[SENT_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]; t->incoming_stream = s; grpc_chttp2_stream_map_add(&t->stream_map, s->id, s); } - s->outgoing_window = - t->settings[PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]; - s->incoming_window = - t->settings[SENT_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]; s->queued_write_closed = 0; s->sending_write_closed = 0; s->sent_write_closed = 0; @@ -983,6 +985,10 @@ static void maybe_start_some_streams(transport *t) { GPR_ASSERT(s->id == 0); s->id = t->next_stream_id; t->next_stream_id += 2; + s->outgoing_window = + t->settings[PEER_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]; + s->incoming_window = + t->settings[SENT_SETTINGS][GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]; grpc_chttp2_stream_map_add(&t->stream_map, s->id, s); stream_list_join(t, s, WRITABLE); } |