Fix for returned status

If we already have a status from the wire when we're disconnecting,
leave it in place - don't overwrite it. Fixes disappearing_server_test.
reviewable/pr3993/r2
Craig Tiller 9 years ago
parent 5925603101
commit 4b65b1dec3
  1. 11
      src/core/transport/chttp2_transport.c

@ -1026,18 +1026,13 @@ void grpc_chttp2_fake_status(grpc_exec_ctx *exec_ctx,
stream_global->seen_error = 1;
grpc_chttp2_list_add_check_read_ops(transport_global, stream_global);
}
if (stream_global->published_trailing_metadata &&
stream_global->recv_trailing_metadata_finished != NULL) {
/* last chance replacement: we've received trailing metadata,
/* stream_global->recv_trailing_metadata_finished gives us a
last chance replacement: we've received trailing metadata,
but something more important has become available to signal
to the upper layers - drop what we've got, and then publish
what we want - which is safe because we haven't told anyone
about the metadata yet */
grpc_chttp2_incoming_metadata_buffer_reset(
&stream_global->received_trailing_metadata);
stream_global->published_trailing_metadata = 0;
}
if (!stream_global->published_trailing_metadata) {
if (!stream_global->published_trailing_metadata || stream_global->recv_trailing_metadata_finished != NULL) {
grpc_mdctx *mdctx =
TRANSPORT_FROM_GLOBAL(transport_global)->metadata_context;
char status_string[GPR_LTOA_MIN_BUFSIZE];

Loading…
Cancel
Save