aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-12-09 20:49:09 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-12-09 20:49:09 -0800
commitc8b7013be30f003e501e743cec856c739db3e160 (patch)
treeffd43f13ca6a2f8fded3cb5154af4a2bc93851b7 /src
parent49656aaa552eb9921d5600b01bbe929d8336a639 (diff)
Fix flow control bug
Diffstat (limited to 'src')
-rw-r--r--src/core/security/server_auth_filter.c2
-rw-r--r--src/core/transport/chttp2_transport.c19
2 files changed, 10 insertions, 11 deletions
diff --git a/src/core/security/server_auth_filter.c b/src/core/security/server_auth_filter.c
index 5cfee6d139..d5c8c54369 100644
--- a/src/core/security/server_auth_filter.c
+++ b/src/core/security/server_auth_filter.c
@@ -140,7 +140,7 @@ static void on_md_processing_done(
message = gpr_slice_from_copied_string(error_details);
calld->transport_op.send_initial_metadata = NULL;
if (calld->transport_op.send_message != NULL) {
- grpc_byte_stream_destroy(calld->transport_op.send_message);
+ grpc_byte_stream_destroy(&exec_ctx, calld->transport_op.send_message);
calld->transport_op.send_message = NULL;
}
calld->transport_op.send_trailing_metadata = NULL;
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c
index cfaa96772c..deb903324e 100644
--- a/src/core/transport/chttp2_transport.c
+++ b/src/core/transport/chttp2_transport.c
@@ -134,6 +134,11 @@ static void connectivity_state_set(
static void check_read_ops(grpc_exec_ctx *exec_ctx,
grpc_chttp2_transport_global *transport_global);
+static void incoming_byte_stream_update_flow_control(
+ grpc_chttp2_transport_global *transport_global,
+ grpc_chttp2_stream_global *stream_global, size_t max_size_hint,
+ size_t have_already);
+
/*
* CONSTRUCTION/DESTRUCTION/REFCOUNTING
*/
@@ -858,6 +863,9 @@ static void perform_stream_op_locked(
GPR_ASSERT(stream_global->recv_message_ready == NULL);
stream_global->recv_message_ready = op->recv_message_ready;
stream_global->recv_message = op->recv_message;
+ if (stream_global->incoming_frames.head != NULL) {
+ incoming_byte_stream_update_flow_control(transport_global, stream_global, 5, 0);
+ }
grpc_chttp2_list_add_check_read_ops(transport_global, stream_global);
}
@@ -1475,16 +1483,7 @@ static void incoming_byte_stream_unref(grpc_chttp2_incoming_byte_stream *bs) {
}
static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) {
- grpc_chttp2_incoming_byte_stream *incoming_byte_stream =
- (grpc_chttp2_incoming_byte_stream *)byte_stream;
- if (incoming_byte_stream->base.length == 0 && incoming_byte_stream->is_tail) {
- lock(incoming_byte_stream->transport);
- incoming_byte_stream_update_flow_control(
- &incoming_byte_stream->transport->global,
- &incoming_byte_stream->stream->global, 0, 0);
- unlock(exec_ctx, incoming_byte_stream->transport);
- }
- incoming_byte_stream_unref(incoming_byte_stream);
+ incoming_byte_stream_unref((grpc_chttp2_incoming_byte_stream *)byte_stream);
}
void grpc_chttp2_incoming_byte_stream_push(grpc_exec_ctx *exec_ctx,