diff options
Diffstat (limited to 'src/core/transport')
-rw-r--r-- | src/core/transport/chttp2/writing.c | 1 | ||||
-rw-r--r-- | src/core/transport/chttp2_transport.c | 23 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/core/transport/chttp2/writing.c b/src/core/transport/chttp2/writing.c index 805d05222d..265448641a 100644 --- a/src/core/transport/chttp2/writing.c +++ b/src/core/transport/chttp2/writing.c @@ -342,7 +342,6 @@ void grpc_chttp2_cleanup_writing( } if (stream_writing->sent_message) { GPR_ASSERT(stream_writing->send_message == NULL); - GPR_ASSERT(stream_global->send_message_finished); grpc_chttp2_complete_closure_step( exec_ctx, &stream_global->send_message_finished, 1); stream_writing->sent_message = 0; diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index aa459c8bac..91c1a27cff 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -115,6 +115,11 @@ static void close_from_api(grpc_exec_ctx *exec_ctx, grpc_status_code status, gpr_slice *optional_message); +/** Fail any outstanding ops */ +static void fail_all_outstanding_ops( + grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global, + grpc_chttp2_stream_global *stream_global); + /** Add endpoint from this transport to pollset */ static void add_to_pollset_locked(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, @@ -748,6 +753,21 @@ void grpc_chttp2_complete_closure_step(grpc_exec_ctx *exec_ctx, *pclosure = NULL; } +static void fail_all_outstanding_ops( + grpc_exec_ctx *exec_ctx, grpc_chttp2_transport_global *transport_global, + grpc_chttp2_stream_global *stream_global) { + grpc_chttp2_complete_closure_step( + exec_ctx, &stream_global->send_initial_metadata_finished, 0); + grpc_chttp2_complete_closure_step( + exec_ctx, &stream_global->send_trailing_metadata_finished, 0); + grpc_chttp2_complete_closure_step(exec_ctx, + &stream_global->send_message_finished, 0); + grpc_chttp2_complete_closure_step( + exec_ctx, &stream_global->recv_initial_metadata_finished, 0); + grpc_chttp2_complete_closure_step( + exec_ctx, &stream_global->recv_trailing_metadata_finished, 0); +} + static int contains_non_ok_status( grpc_chttp2_transport_global *transport_global, grpc_metadata_batch *batch) { @@ -1022,6 +1042,9 @@ static void check_read_ops(grpc_exec_ctx *exec_ctx, exec_ctx, &stream_global->recv_trailing_metadata_finished, 1); } } + if (stream_global->finished_close) { + fail_all_outstanding_ops(exec_ctx, transport_global, stream_global); + } } } |