Break after WriteLast() (#27165)

If we continue to call `Write()` after `WriteLast()` (because client is still sending us data and thus `Read()` returns `true`), the buffer might become invalid and results in assertion failures.
reviewable/pr27173/r1
Ta-Wei Tu 4 years ago committed by GitHub
parent 7e532fd198
commit 7dd1da9e1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      test/cpp/end2end/test_service_impl.h

@ -403,6 +403,7 @@ class TestMultipleServiceImpl : public RpcService {
response.set_message(request.message());
if (read_counts == server_write_last) {
stream->WriteLast(response, WriteOptions());
break;
} else {
stream->Write(response);
}

Loading…
Cancel
Save