diff options
author | Yihua Zhang <yihuaz@google.com> | 2018-11-12 20:00:37 -0800 |
---|---|---|
committer | Yihua Zhang <yihuaz@google.com> | 2018-11-12 20:00:37 -0800 |
commit | 99d8216d065bfe9860589d0d71c78214229317a9 (patch) | |
tree | 4aef355adfdc4ebaeaf5a665665c6e1d23b1c81c /src/core/lib/surface | |
parent | 37f87651114f52868cafa8fdd2d7d622784b568c (diff) |
create internal version of grpc_call_cancel.
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r-- | src/core/lib/surface/call.cc | 4 | ||||
-rw-r--r-- | src/core/lib/surface/call.h | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/core/lib/surface/call.cc b/src/core/lib/surface/call.cc index 735a78ad08..89b3f77822 100644 --- a/src/core/lib/surface/call.cc +++ b/src/core/lib/surface/call.cc @@ -694,6 +694,10 @@ static void cancel_with_error(grpc_call* c, grpc_error* error) { execute_batch(c, op, &state->start_batch); } +void grpc_call_cancel_internal(grpc_call* call) { + cancel_with_error(call, GRPC_ERROR_CANCELLED); +} + static grpc_error* error_from_status(grpc_status_code status, const char* description) { // copying 'description' is needed to ensure the grpc_call_cancel_with_status diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h index b34260505a..bd7295fe11 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -81,6 +81,10 @@ grpc_call_error grpc_call_start_batch_and_execute(grpc_call* call, size_t nops, grpc_closure* closure); +/* gRPC core internal version of grpc_call_cancel that does not create + * exec_ctx. */ +void grpc_call_cancel_internal(grpc_call* call); + /* Given the top call_element, get the call object. */ grpc_call* grpc_call_from_top_element(grpc_call_element* surface_element); |