aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-04-07 00:34:19 -0700
committerGravatar Muxi Yan <mxyan@google.com>2017-04-07 00:34:19 -0700
commit97a0ded7c59a123dfe2be0d2a4e0e27b58754a1b (patch)
tree52b8d26bb1279aa5bcceca5cff5fb5dcddb25cd9 /test/cpp
parent50da9d83b6420c8028b11903232db144a4eabf23 (diff)
Fix bm_chttp2_transport
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/microbenchmarks/bm_chttp2_transport.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
index 1611250850..d3ca27a68e 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
@@ -572,11 +572,13 @@ static void BM_TransportStreamRecv(benchmark::State &state) {
} while (grpc_byte_stream_next(exec_ctx, recv_stream,
recv_stream->length - received,
drain_continue.get()) &&
- GRPC_ERROR_NONE == grpc_byte_stream_pull(exec_ctx, recv_stream,
- &recv_slice));
+ GRPC_ERROR_NONE ==
+ grpc_byte_stream_pull(exec_ctx, recv_stream, &recv_slice) &&
+ (received += GRPC_SLICE_LENGTH(recv_slice), true));
});
drain_continue = MakeClosure([&](grpc_exec_ctx *exec_ctx, grpc_error *error) {
+ grpc_byte_stream_pull(exec_ctx, recv_stream, &recv_slice);
received += GRPC_SLICE_LENGTH(recv_slice);
grpc_slice_unref_internal(exec_ctx, recv_slice);
grpc_closure_run(exec_ctx, drain.get(), GRPC_ERROR_NONE);