Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1 | /* |
| 2 | * |
David Garcia Quintas | 3598d44 | 2016-03-15 14:53:05 -0700 | [diff] [blame] | 3 | * Copyright 2015-2016, Google Inc. |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 4 | * All rights reserved. |
| 5 | * |
| 6 | * Redistribution and use in source and binary forms, with or without |
| 7 | * modification, are permitted provided that the following conditions are |
| 8 | * met: |
| 9 | * |
| 10 | * * Redistributions of source code must retain the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer. |
| 12 | * * Redistributions in binary form must reproduce the above |
| 13 | * copyright notice, this list of conditions and the following disclaimer |
| 14 | * in the documentation and/or other materials provided with the |
| 15 | * distribution. |
| 16 | * * Neither the name of Google Inc. nor the names of its |
| 17 | * contributors may be used to endorse or promote products derived from |
| 18 | * this software without specific prior written permission. |
| 19 | * |
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | * |
| 32 | */ |
| 33 | |
Craig Tiller | 9a4dddd | 2016-03-25 17:08:13 -0700 | [diff] [blame] | 34 | #ifndef GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_H |
| 35 | #define GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_H |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 36 | |
| 37 | /* A channel filter defines how operations on a channel are implemented. |
| 38 | Channel filters are chained together to create full channels, and if those |
| 39 | chains are linear, then channel stacks provide a mechanism to minimize |
| 40 | allocations for that chain. |
| 41 | Call stacks are created by channel stacks and represent the per-call data |
| 42 | for that stack. */ |
| 43 | |
| 44 | #include <stddef.h> |
| 45 | |
| 46 | #include <grpc/grpc.h> |
| 47 | #include <grpc/support/log.h> |
Craig Tiller | 6e7c622 | 2015-02-20 15:31:21 -0800 | [diff] [blame] | 48 | #include "src/core/debug/trace.h" |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 49 | #include "src/core/transport/transport.h" |
| 50 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 51 | typedef struct grpc_channel_element grpc_channel_element; |
| 52 | typedef struct grpc_call_element grpc_call_element; |
| 53 | |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 54 | typedef struct grpc_channel_stack grpc_channel_stack; |
| 55 | typedef struct grpc_call_stack grpc_call_stack; |
| 56 | |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 57 | typedef struct { |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 58 | grpc_channel_stack *channel_stack; |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 59 | const grpc_channel_args *channel_args; |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 60 | int is_first; |
| 61 | int is_last; |
| 62 | } grpc_channel_element_args; |
| 63 | |
| 64 | typedef struct { |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 65 | grpc_call_stack *call_stack; |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 66 | const void *server_transport_data; |
| 67 | grpc_call_context_element *context; |
| 68 | } grpc_call_element_args; |
| 69 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 70 | /* Channel filters specify: |
| 71 | 1. the amount of memory needed in the channel & call (via the sizeof_XXX |
| 72 | members) |
| 73 | 2. functions to initialize and destroy channel & call data |
| 74 | (init_XXX, destroy_XXX) |
| 75 | 3. functions to implement call operations and channel operations (call_op, |
| 76 | channel_op) |
| 77 | 4. a name, which is useful when debugging |
| 78 | |
| 79 | Members are laid out in approximate frequency of use order. */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 80 | typedef struct { |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 81 | /* Called to eg. send/receive data on a call. |
| 82 | See grpc_call_next_op on how to call the next element in the stack */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 83 | void (*start_transport_stream_op)(grpc_exec_ctx *exec_ctx, |
| 84 | grpc_call_element *elem, |
| 85 | grpc_transport_stream_op *op); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 86 | /* Called to handle channel level operations - e.g. new calls, or transport |
| 87 | closure. |
| 88 | See grpc_channel_next_op on how to call the next element in the stack */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 89 | void (*start_transport_op)(grpc_exec_ctx *exec_ctx, |
| 90 | grpc_channel_element *elem, grpc_transport_op *op); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 91 | |
| 92 | /* sizeof(per call data) */ |
| 93 | size_t sizeof_call_data; |
| 94 | /* Initialize per call data. |
| 95 | elem is initialized at the start of the call, and elem->call_data is what |
| 96 | needs initializing. |
| 97 | The filter does not need to do any chaining. |
| 98 | server_transport_data is an opaque pointer. If it is NULL, this call is |
| 99 | on a client; if it is non-NULL, then it points to memory owned by the |
| 100 | transport and is on the server. Most filters want to ignore this |
Craig Tiller | 45724b3 | 2015-09-22 10:42:19 -0700 | [diff] [blame] | 101 | argument. */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 102 | void (*init_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 103 | grpc_call_element_args *args); |
| 104 | void (*set_pollset)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, |
| 105 | grpc_pollset *pollset); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 106 | /* Destroy per call data. |
| 107 | The filter does not need to do any chaining */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 108 | void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 109 | |
| 110 | /* sizeof(per channel data) */ |
| 111 | size_t sizeof_channel_data; |
| 112 | /* Initialize per-channel data. |
| 113 | elem is initialized at the start of the call, and elem->channel_data is |
| 114 | what needs initializing. |
| 115 | is_first, is_last designate this elements position in the stack, and are |
| 116 | useful for asserting correct configuration by upper layer code. |
| 117 | The filter does not need to do any chaining */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 118 | void (*init_channel_elem)(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 119 | grpc_channel_element_args *args); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 120 | /* Destroy per channel data. |
| 121 | The filter does not need to do any chaining */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 122 | void (*destroy_channel_elem)(grpc_exec_ctx *exec_ctx, |
| 123 | grpc_channel_element *elem); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 124 | |
Craig Tiller | 1b22b9d | 2015-07-20 13:42:22 -0700 | [diff] [blame] | 125 | /* Implement grpc_call_get_peer() */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 126 | char *(*get_peer)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem); |
Craig Tiller | 1b22b9d | 2015-07-20 13:42:22 -0700 | [diff] [blame] | 127 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 128 | /* The name of this filter */ |
| 129 | const char *name; |
| 130 | } grpc_channel_filter; |
| 131 | |
| 132 | /* A channel_element tracks its filter and the filter requested memory within |
| 133 | a channel allocation */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 134 | struct grpc_channel_element { |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 135 | const grpc_channel_filter *filter; |
| 136 | void *channel_data; |
| 137 | }; |
| 138 | |
| 139 | /* A call_element tracks its filter, the filter requested memory within |
| 140 | a channel allocation, and the filter requested memory within a call |
| 141 | allocation */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 142 | struct grpc_call_element { |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 143 | const grpc_channel_filter *filter; |
| 144 | void *channel_data; |
| 145 | void *call_data; |
| 146 | }; |
| 147 | |
| 148 | /* A channel stack tracks a set of related filters for one channel, and |
| 149 | guarantees they live within a single malloc() allocation */ |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 150 | struct grpc_channel_stack { |
| 151 | grpc_stream_refcount refcount; |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 152 | size_t count; |
| 153 | /* Memory required for a call stack (computed at channel stack |
| 154 | initialization) */ |
| 155 | size_t call_stack_size; |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 156 | }; |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 157 | |
| 158 | /* A call stack tracks a set of related filters for one call, and guarantees |
| 159 | they live within a single malloc() allocation */ |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 160 | struct grpc_call_stack { |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 161 | /* shared refcount for this channel stack. |
| 162 | MUST be the first element: the underlying code calls destroy |
| 163 | with the address of the refcount, but higher layers prefer to think |
| 164 | about the address of the call stack itself. */ |
| 165 | grpc_stream_refcount refcount; |
| 166 | size_t count; |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 167 | }; |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 168 | |
| 169 | /* Get a channel element given a channel stack and its index */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 170 | grpc_channel_element *grpc_channel_stack_element(grpc_channel_stack *stack, |
| 171 | size_t i); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 172 | /* Get the last channel element in a channel stack */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 173 | grpc_channel_element *grpc_channel_stack_last_element( |
| 174 | grpc_channel_stack *stack); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 175 | /* Get a call stack element given a call stack and an index */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 176 | grpc_call_element *grpc_call_stack_element(grpc_call_stack *stack, size_t i); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 177 | |
| 178 | /* Determine memory required for a channel stack containing a set of filters */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 179 | size_t grpc_channel_stack_size(const grpc_channel_filter **filters, |
| 180 | size_t filter_count); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 181 | /* Initialize a channel stack given some filters */ |
Craig Tiller | 7b43561 | 2015-11-24 08:15:05 -0800 | [diff] [blame] | 182 | void grpc_channel_stack_init(grpc_exec_ctx *exec_ctx, int initial_refs, |
| 183 | grpc_iomgr_cb_func destroy, void *destroy_arg, |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 184 | const grpc_channel_filter **filters, |
Craig Tiller | 7b43561 | 2015-11-24 08:15:05 -0800 | [diff] [blame] | 185 | size_t filter_count, const grpc_channel_args *args, |
Craig Tiller | 1d881fb | 2015-12-01 07:39:04 -0800 | [diff] [blame] | 186 | const char *name, grpc_channel_stack *stack); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 187 | /* Destroy a channel stack */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 188 | void grpc_channel_stack_destroy(grpc_exec_ctx *exec_ctx, |
| 189 | grpc_channel_stack *stack); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 190 | |
| 191 | /* Initialize a call stack given a channel stack. transport_server_data is |
| 192 | expected to be NULL on a client, or an opaque transport owned pointer on the |
| 193 | server. */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 194 | void grpc_call_stack_init(grpc_exec_ctx *exec_ctx, |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 195 | grpc_channel_stack *channel_stack, int initial_refs, |
| 196 | grpc_iomgr_cb_func destroy, void *destroy_arg, |
| 197 | grpc_call_context_element *context, |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 198 | const void *transport_server_data, |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 199 | grpc_call_stack *call_stack); |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 200 | /* Set a pollset for a call stack: must occur before the first op is started */ |
| 201 | void grpc_call_stack_set_pollset(grpc_exec_ctx *exec_ctx, |
| 202 | grpc_call_stack *call_stack, |
| 203 | grpc_pollset *pollset); |
| 204 | |
| 205 | #ifdef GRPC_STREAM_REFCOUNT_DEBUG |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 206 | #define GRPC_CALL_STACK_REF(call_stack, reason) \ |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 207 | grpc_stream_ref(&(call_stack)->refcount, reason) |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 208 | #define GRPC_CALL_STACK_UNREF(exec_ctx, call_stack, reason) \ |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 209 | grpc_stream_unref(exec_ctx, &(call_stack)->refcount, reason) |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 210 | #define GRPC_CHANNEL_STACK_REF(channel_stack, reason) \ |
| 211 | grpc_stream_ref(&(channel_stack)->refcount, reason) |
| 212 | #define GRPC_CHANNEL_STACK_UNREF(exec_ctx, channel_stack, reason) \ |
| 213 | grpc_stream_unref(exec_ctx, &(channel_stack)->refcount, reason) |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 214 | #else |
Craig Tiller | 7b43561 | 2015-11-24 08:15:05 -0800 | [diff] [blame] | 215 | #define GRPC_CALL_STACK_REF(call_stack, reason) \ |
| 216 | grpc_stream_ref(&(call_stack)->refcount) |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 217 | #define GRPC_CALL_STACK_UNREF(exec_ctx, call_stack, reason) \ |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 218 | grpc_stream_unref(exec_ctx, &(call_stack)->refcount) |
Craig Tiller | 7b43561 | 2015-11-24 08:15:05 -0800 | [diff] [blame] | 219 | #define GRPC_CHANNEL_STACK_REF(channel_stack, reason) \ |
| 220 | grpc_stream_ref(&(channel_stack)->refcount) |
Craig Tiller | 906e3bc | 2015-11-24 07:31:31 -0800 | [diff] [blame] | 221 | #define GRPC_CHANNEL_STACK_UNREF(exec_ctx, channel_stack, reason) \ |
| 222 | grpc_stream_unref(exec_ctx, &(channel_stack)->refcount) |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 223 | #endif |
| 224 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 225 | /* Destroy a call stack */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 226 | void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 227 | |
Craig Tiller | 892f2d3 | 2015-11-08 13:53:04 +0000 | [diff] [blame] | 228 | /* Ignore set pollset - used by filters to implement the set_pollset method |
| 229 | if they don't care about pollsets at all. Does nothing. */ |
Craig Tiller | 577c9b2 | 2015-11-02 14:11:15 -0800 | [diff] [blame] | 230 | void grpc_call_stack_ignore_set_pollset(grpc_exec_ctx *exec_ctx, |
| 231 | grpc_call_element *elem, |
| 232 | grpc_pollset *pollset); |
Craig Tiller | 83f88d9 | 2015-04-21 16:02:05 -0700 | [diff] [blame] | 233 | /* Call the next operation in a call stack */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 234 | void grpc_call_next_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, |
| 235 | grpc_transport_stream_op *op); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 236 | /* Call the next operation (depending on call directionality) in a channel |
| 237 | stack */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 238 | void grpc_channel_next_op(grpc_exec_ctx *exec_ctx, grpc_channel_element *elem, |
| 239 | grpc_transport_op *op); |
Craig Tiller | 1b22b9d | 2015-07-20 13:42:22 -0700 | [diff] [blame] | 240 | /* Pass through a request to get_peer to the next child element */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 241 | char *grpc_call_next_get_peer(grpc_exec_ctx *exec_ctx, grpc_call_element *elem); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 242 | |
| 243 | /* Given the top element of a channel stack, get the channel stack itself */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 244 | grpc_channel_stack *grpc_channel_stack_from_top_element( |
| 245 | grpc_channel_element *elem); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 246 | /* Given the top element of a call stack, get the call stack itself */ |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 247 | grpc_call_stack *grpc_call_stack_from_top_element(grpc_call_element *elem); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 248 | |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 249 | void grpc_call_log_op(char *file, int line, gpr_log_severity severity, |
| 250 | grpc_call_element *elem, grpc_transport_stream_op *op); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 251 | |
Craig Tiller | a82950e | 2015-09-22 12:33:20 -0700 | [diff] [blame] | 252 | void grpc_call_element_send_cancel(grpc_exec_ctx *exec_ctx, |
| 253 | grpc_call_element *cur_elem); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 254 | |
Craig Tiller | faa8480 | 2015-03-01 21:56:38 -0800 | [diff] [blame] | 255 | extern int grpc_trace_channel; |
| 256 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 257 | #define GRPC_CALL_LOG_OP(sev, elem, op) \ |
Craig Tiller | faa8480 | 2015-03-01 21:56:38 -0800 | [diff] [blame] | 258 | if (grpc_trace_channel) grpc_call_log_op(sev, elem, op) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 259 | |
Craig Tiller | 9a4dddd | 2016-03-25 17:08:13 -0700 | [diff] [blame] | 260 | #endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_STACK_H */ |