Skip to content
Snippets Groups Projects
Commit e10c3338 authored by Muxi Yan's avatar Muxi Yan
Browse files

Send reset from the client when server closes stream unexpectedly

parent 14fe5187
No related branches found
No related tags found
No related merge requests found
...@@ -253,8 +253,16 @@ void grpc_chttp2_publish_reads( ...@@ -253,8 +253,16 @@ void grpc_chttp2_publish_reads(
} }
if (stream_parsing->received_close) { if (stream_parsing->received_close) {
grpc_chttp2_mark_stream_closed(exec_ctx, transport_global, stream_global, if (transport_global->is_client && !stream_global->write_closed) {
1, 0, GRPC_ERROR_NONE); gpr_slice_buffer_add(&transport_global->qbuf,
grpc_chttp2_rst_stream_create(transport_parsing->incoming_stream_id, GRPC_CHTTP2_NO_ERROR, &stream_parsing->stats.outgoing));
grpc_chttp2_initiate_write(exec_ctx, transport_global, false, "rst");
grpc_chttp2_mark_stream_closed(exec_ctx, transport_global, stream_global,
1, 1, GRPC_ERROR_NONE);
} else {
grpc_chttp2_mark_stream_closed(exec_ctx, transport_global, stream_global,
1, 0, GRPC_ERROR_NONE);
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment