From e9c216ee23297490de8c3350d0b2fa1115d5c3da Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 6 Nov 2015 14:48:46 -0800 Subject: [PATCH] Sending empty trailing metadata to a closed stream is ok - it means close this already closed stream --- src/core/transport/chttp2_transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index cbde3c5b865..f62294c7c50 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -806,7 +806,8 @@ static void perform_stream_op_locked( } if (stream_global->write_closed) { grpc_chttp2_complete_closure_step( - exec_ctx, &stream_global->send_trailing_metadata_finished, 0); + exec_ctx, &stream_global->send_trailing_metadata_finished, + grpc_metadata_batch_is_empty(op->send_trailing_metadata)); } else if (stream_global->id != 0) { /* TODO(ctiller): check if there's flow control for any outstanding bytes before going writable */