From 366270eee58df0c59dd3c7453e5ffd0d3d9eebc5 Mon Sep 17 00:00:00 2001 From: Muxi Yan <mxyan@google.com> Date: Fri, 23 Jun 2017 18:08:27 -0700 Subject: [PATCH] Fix test --- src/core/ext/transport/cronet/transport/cronet_transport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 498b444001..29dfa885de 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -799,11 +799,13 @@ static bool op_can_be_run(grpc_transport_stream_op_batch *curr_op, } /* ON_COMPLETE can be processed if one of the following conditions is met: * 1. the stream failed - * 2. the stream is cancelled, and the callback is received, or - * 3. the stream is cancelled, and the stream is never started */ + * 2. the stream is cancelled, and the callback is received + * 3. the stream succeeded before cancel is effective + * 4. the stream is cancelled, and the stream is never started */ if (op_id == OP_ON_COMPLETE && !(stream_state->state_callback_received[OP_FAILED] || stream_state->state_callback_received[OP_CANCELED] || + stream_state->state_callback_received[OP_SUCCEEDED] || !stream_state->state_op_done[OP_SEND_INITIAL_METADATA])) { CRONET_LOG(GPR_DEBUG, "Because"); result = false; -- GitLab