diff options
author | 2014-12-17 21:23:05 -0800 | |
---|---|---|
committer | 2014-12-19 13:12:23 -0800 | |
commit | bcd6259a951cce716020e1f8006765249072a05c (patch) | |
tree | 66168b9361c7d2efc68e1d8c5429b20e42005310 /src/core/channel/client_channel.c | |
parent | b74550655a3d5eb5deebd86b692541994efe63bb (diff) |
Properly handle cancellation during downwards propagation.
Change on 2014/12/17 by ctiller <ctiller@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82395253
Diffstat (limited to 'src/core/channel/client_channel.c')
-rw-r--r-- | src/core/channel/client_channel.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/core/channel/client_channel.c b/src/core/channel/client_channel.c index 6329932330..fd883a08ca 100644 --- a/src/core/channel/client_channel.c +++ b/src/core/channel/client_channel.c @@ -258,7 +258,6 @@ static void cancel_rpc(grpc_call_element *elem, grpc_call_op *op) { static void call_op(grpc_call_element *elem, grpc_call_element *from_elem, grpc_call_op *op) { call_data *calld = elem->call_data; - grpc_call_element *child_elem; GPR_ASSERT(elem->filter == &grpc_client_channel_filter); GRPC_CALL_LOG_OP(GPR_INFO, elem, op); @@ -277,19 +276,21 @@ static void call_op(grpc_call_element *elem, grpc_call_element *from_elem, case GRPC_CANCEL_OP: cancel_rpc(elem, op); break; - default: - switch (op->dir) { - case GRPC_CALL_UP: - grpc_call_next_op(elem, op); - break; - case GRPC_CALL_DOWN: - child_elem = - grpc_child_call_get_top_element(calld->s.active.child_call); - GPR_ASSERT(calld->state == CALL_ACTIVE); - child_elem->filter->call_op(child_elem, elem, op); - break; + case GRPC_SEND_MESSAGE: + case GRPC_SEND_FINISH: + case GRPC_REQUEST_DATA: + if (calld->state == CALL_ACTIVE) { + grpc_call_element *child_elem = + grpc_child_call_get_top_element(calld->s.active.child_call); + child_elem->filter->call_op(child_elem, elem, op); + } else { + op->done_cb(op->user_data, GRPC_OP_ERROR); } break; + default: + GPR_ASSERT(op->dir == GRPC_CALL_UP); + grpc_call_next_op(elem, op); + break; } } |