aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp
diff options
context:
space:
mode:
authorGravatar Muxi Yan <muxi@users.noreply.github.com>2017-04-14 14:10:55 -0700
committerGravatar GitHub <noreply@github.com>2017-04-14 14:10:55 -0700
commit9d129e751f0e68cc510d9110c8ce2a5e1a3962ec (patch)
tree7b74a5991d95e1f1bb1885d6725d2dbf13f25030 /test/cpp
parente412a180602753972ac496560322e224a5db987f (diff)
parent3136568e36abf32891cef392b02dddc9f8916d11 (diff)
Merge pull request #10626 from grpc/revert-10619-revert-9626-lazy-deframe
Revert "Revert "Implement lazy deframe""
Diffstat (limited to 'test/cpp')
-rw-r--r--test/cpp/microbenchmarks/bm_chttp2_transport.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/cpp/microbenchmarks/bm_chttp2_transport.cc b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
index c89f349ca7..8c5413b5fd 100644
--- a/test/cpp/microbenchmarks/bm_chttp2_transport.cc
+++ b/test/cpp/microbenchmarks/bm_chttp2_transport.cc
@@ -569,12 +569,17 @@ static void BM_TransportStreamRecv(benchmark::State &state) {
grpc_closure_sched(exec_ctx, c.get(), GRPC_ERROR_NONE);
return;
}
- } while (grpc_byte_stream_next(exec_ctx, recv_stream, &recv_slice,
+ } while (grpc_byte_stream_next(exec_ctx, recv_stream,
recv_stream->length - received,
- drain_continue.get()));
+ drain_continue.get()) &&
+ GRPC_ERROR_NONE ==
+ grpc_byte_stream_pull(exec_ctx, recv_stream, &recv_slice) &&
+ (received += GRPC_SLICE_LENGTH(recv_slice),
+ grpc_slice_unref_internal(exec_ctx, 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);