aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/channel/channel_stack.c
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2017-01-20 13:39:08 -0800
committerGravatar GitHub <noreply@github.com>2017-01-20 13:39:08 -0800
commit28ec869b5a2567cd30a6e3bcc0efbee0ab0ae7f5 (patch)
treebe591d8c9033c3c4aa064b458acc8e7fe62d7598 /src/core/lib/channel/channel_stack.c
parentbd827887ffbb57a95990130f585913b13f44a5b7 (diff)
parent2b5cf1ff2681bb94fa1e3651f8ccfc14bdfa71b2 (diff)
Merge pull request #8842 from ctiller/metadata_filter
Metadata handling rewrite
Diffstat (limited to 'src/core/lib/channel/channel_stack.c')
-rw-r--r--src/core/lib/channel/channel_stack.c43
1 files changed, 6 insertions, 37 deletions
diff --git a/src/core/lib/channel/channel_stack.c b/src/core/lib/channel/channel_stack.c
index 8f08b427fb..ec973d4e7f 100644
--- a/src/core/lib/channel/channel_stack.c
+++ b/src/core/lib/channel/channel_stack.c
@@ -170,7 +170,7 @@ grpc_error *grpc_call_stack_init(
grpc_exec_ctx *exec_ctx, grpc_channel_stack *channel_stack,
int initial_refs, grpc_iomgr_cb_func destroy, void *destroy_arg,
grpc_call_context_element *context, const void *transport_server_data,
- grpc_mdstr *path, gpr_timespec start_time, gpr_timespec deadline,
+ grpc_slice path, gpr_timespec start_time, gpr_timespec deadline,
grpc_call_stack *call_stack) {
grpc_channel_element *channel_elems = CHANNEL_ELEMS_FROM_STACK(channel_stack);
grpc_call_element_args args;
@@ -288,41 +288,10 @@ grpc_call_stack *grpc_call_stack_from_top_element(grpc_call_element *elem) {
sizeof(grpc_call_stack)));
}
-static void destroy_op(grpc_exec_ctx *exec_ctx, void *op, grpc_error *error) {
- gpr_free(op);
-}
-
-void grpc_call_element_send_cancel(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
- grpc_transport_stream_op *op = gpr_malloc(sizeof(*op));
- memset(op, 0, sizeof(*op));
- op->cancel_error = GRPC_ERROR_CANCELLED;
- op->on_complete =
- grpc_closure_create(destroy_op, op, grpc_schedule_on_exec_ctx);
- elem->filter->start_transport_stream_op(exec_ctx, elem, op);
-}
-
-void grpc_call_element_send_cancel_with_message(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem,
- grpc_status_code status,
- grpc_slice *optional_message) {
- grpc_transport_stream_op *op = gpr_malloc(sizeof(*op));
- memset(op, 0, sizeof(*op));
- op->on_complete =
- grpc_closure_create(destroy_op, op, grpc_schedule_on_exec_ctx);
- grpc_transport_stream_op_add_cancellation_with_message(exec_ctx, op, status,
- optional_message);
- elem->filter->start_transport_stream_op(exec_ctx, elem, op);
-}
-
-void grpc_call_element_send_close_with_message(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem,
- grpc_status_code status,
- grpc_slice *optional_message) {
- grpc_transport_stream_op *op = gpr_malloc(sizeof(*op));
- memset(op, 0, sizeof(*op));
- op->on_complete =
- grpc_closure_create(destroy_op, op, grpc_schedule_on_exec_ctx);
- grpc_transport_stream_op_add_close(exec_ctx, op, status, optional_message);
+void grpc_call_element_signal_error(grpc_exec_ctx *exec_ctx,
+ grpc_call_element *elem,
+ grpc_error *error) {
+ grpc_transport_stream_op *op = grpc_make_transport_stream_op(NULL);
+ op->cancel_error = error;
elem->filter->start_transport_stream_op(exec_ctx, elem, op);
}