Skip to content
Snippets Groups Projects
Commit ca9a6378 authored by Craig Tiller's avatar Craig Tiller
Browse files

Fix double read at end of stream bug

parent 8ccebc40
No related branches found
No related tags found
No related merge requests found
...@@ -1060,6 +1060,7 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp, ...@@ -1060,6 +1060,7 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
if (call->receiving_stream == NULL) { if (call->receiving_stream == NULL) {
*call->receiving_buffer = NULL; *call->receiving_buffer = NULL;
call->receiving_message = 0;
if (gpr_unref(&bctl->steps_to_complete)) { if (gpr_unref(&bctl->steps_to_complete)) {
post_batch_completion(exec_ctx, bctl); post_batch_completion(exec_ctx, bctl);
} }
...@@ -1070,6 +1071,7 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp, ...@@ -1070,6 +1071,7 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp,
grpc_byte_stream_destroy(call->receiving_stream); grpc_byte_stream_destroy(call->receiving_stream);
call->receiving_stream = NULL; call->receiving_stream = NULL;
*call->receiving_buffer = NULL; *call->receiving_buffer = NULL;
call->receiving_message = 0;
if (gpr_unref(&bctl->steps_to_complete)) { if (gpr_unref(&bctl->steps_to_complete)) {
post_batch_completion(exec_ctx, bctl); post_batch_completion(exec_ctx, bctl);
} }
......
...@@ -543,6 +543,7 @@ TEST_P(End2endTest, BidiStream) { ...@@ -543,6 +543,7 @@ TEST_P(End2endTest, BidiStream) {
stream->WritesDone(); stream->WritesDone();
EXPECT_FALSE(stream->Read(&response)); EXPECT_FALSE(stream->Read(&response));
EXPECT_FALSE(stream->Read(&response));
Status s = stream->Finish(); Status s = stream->Finish();
EXPECT_TRUE(s.ok()); EXPECT_TRUE(s.ok());
......
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