Tell call/channel op handlers who is invoking them.

This change adds a parameter to all op handlers specifying the invoking filter.
It will be used to allow client_channel to distinguish which child channel is
disconnecting or going away.
	Change on 2014/12/10 by ctiller <ctiller@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=81823231
pull/1/merge
ctiller 10 years ago committed by Jan Tattermusch
parent a8fd44adf8
commit f962f5264b
  1. 9
      src/core/channel/census_filter.c
  2. 4
      src/core/channel/channel_stack.c
  3. 6
      src/core/channel/channel_stack.h
  4. 41
      src/core/channel/client_channel.c
  5. 12
      src/core/channel/connected_channel.c
  6. 6
      src/core/channel/http_client_filter.c
  7. 6
      src/core/channel/http_filter.c
  8. 6
      src/core/channel/http_server_filter.c
  9. 6
      src/core/channel/noop_filter.c
  10. 6
      src/core/security/auth.c
  11. 22
      src/core/surface/call.c
  12. 4
      src/core/surface/channel.c
  13. 6
      src/core/surface/client.c
  14. 6
      src/core/surface/lame_client.c
  15. 10
      src/core/surface/server.c
  16. 6
      test/core/channel/channel_stack_test.c
  17. 12
      test/core/channel/metadata_buffer_test.c

@ -72,7 +72,8 @@ static void extract_and_annotate_method_tag(grpc_call_op* op, call_data* calld,
}
}
static void client_call_op(grpc_call_element* elem, grpc_call_op* op) {
static void client_call_op(grpc_call_element* elem,
grpc_call_element* from_elem, grpc_call_op* op) {
call_data* calld = elem->call_data;
channel_data* chand = elem->channel_data;
GPR_ASSERT(calld != NULL);
@ -92,7 +93,8 @@ static void client_call_op(grpc_call_element* elem, grpc_call_op* op) {
grpc_call_next_op(elem, op);
}
static void server_call_op(grpc_call_element* elem, grpc_call_op* op) {
static void server_call_op(grpc_call_element* elem,
grpc_call_element* from_elem, grpc_call_op* op) {
call_data* calld = elem->call_data;
channel_data* chand = elem->channel_data;
GPR_ASSERT(calld != NULL);
@ -112,7 +114,8 @@ static void server_call_op(grpc_call_element* elem, grpc_call_op* op) {
grpc_call_next_op(elem, op);
}
static void channel_op(grpc_channel_element* elem, grpc_channel_op* op) {
static void channel_op(grpc_channel_element* elem,
grpc_channel_element* from_elem, grpc_channel_op* op) {
switch (op->type) {
case GRPC_TRANSPORT_CLOSED:
/* TODO(hongyu): Annotate trace information for all calls of the channel

@ -180,12 +180,12 @@ void grpc_call_stack_destroy(grpc_call_stack *stack) {
void grpc_call_next_op(grpc_call_element *elem, grpc_call_op *op) {
grpc_call_element *next_elem = elem + op->dir;
next_elem->filter->call_op(next_elem, op);
next_elem->filter->call_op(next_elem, elem, op);
}
void grpc_channel_next_op(grpc_channel_element *elem, grpc_channel_op *op) {
grpc_channel_element *next_elem = elem + op->dir;
next_elem->filter->channel_op(next_elem, op);
next_elem->filter->channel_op(next_elem, elem, op);
}
grpc_channel_stack *grpc_channel_stack_from_top_element(

@ -170,11 +170,13 @@ typedef struct {
typedef struct {
/* Called to eg. send/receive data on a call.
See grpc_call_next_op on how to call the next element in the stack */
void (*call_op)(grpc_call_element *elem, grpc_call_op *op);
void (*call_op)(grpc_call_element *elem, grpc_call_element *from_elem,
grpc_call_op *op);
/* Called to handle channel level operations - e.g. new calls, or transport
closure.
See grpc_channel_next_op on how to call the next element in the stack */
void (*channel_op)(grpc_channel_element *elem, grpc_channel_op *op);
void (*channel_op)(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op);
/* sizeof(per call data) */
size_t sizeof_call_data;

@ -51,12 +51,13 @@ typedef struct { grpc_channel_element *back; } lb_channel_data;
typedef struct { grpc_call_element *back; } lb_call_data;
static void lb_call_op(grpc_call_element *elem, grpc_call_op *op) {
static void lb_call_op(grpc_call_element *elem, grpc_call_element *from_elem,
grpc_call_op *op) {
lb_call_data *calld = elem->call_data;
switch (op->dir) {
case GRPC_CALL_UP:
calld->back->filter->call_op(calld->back, op);
calld->back->filter->call_op(calld->back, elem, op);
break;
case GRPC_CALL_DOWN:
grpc_call_next_op(elem, op);
@ -65,12 +66,14 @@ static void lb_call_op(grpc_call_element *elem, grpc_call_op *op) {
}
/* Currently we assume all channel operations should just be pushed up. */
static void lb_channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void lb_channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem,
grpc_channel_op *op) {
lb_channel_data *chand = elem->channel_data;
switch (op->dir) {
case GRPC_CALL_UP:
chand->back->filter->channel_op(chand->back, op);
chand->back->filter->channel_op(chand->back, elem, op);
break;
case GRPC_CALL_DOWN:
grpc_channel_next_op(elem, op);
@ -201,8 +204,9 @@ static int prepare_activate(call_data *calld, child_entry *on_child) {
static void do_nothing(void *ignored, grpc_op_error error) {}
static void complete_activate(call_data *calld, child_entry *on_child,
static void complete_activate(grpc_call_element *elem, child_entry *on_child,
grpc_call_op *op) {
call_data *calld = elem->call_data;
grpc_call_element *child_elem =
grpc_call_stack_element(calld->s.active.child_stack, 0);
@ -219,15 +223,17 @@ static void complete_activate(call_data *calld, child_entry *on_child,
dop.data.deadline = calld->deadline;
dop.done_cb = do_nothing;
dop.user_data = NULL;
child_elem->filter->call_op(child_elem, &dop);
child_elem->filter->call_op(child_elem, elem, &dop);
}
/* continue the start call down the stack, this nees to happen after metadata
are flushed*/
child_elem->filter->call_op(child_elem, op);
child_elem->filter->call_op(child_elem, elem, op);
}
static void start_rpc(call_data *calld, channel_data *chand, grpc_call_op *op) {
static void start_rpc(grpc_call_element *elem, grpc_call_op *op) {
call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data;
gpr_mu_lock(&chand->mu);
if (calld->state == CALL_CANCELLED) {
gpr_mu_unlock(&chand->mu);
@ -241,7 +247,7 @@ static void start_rpc(call_data *calld, channel_data *chand, grpc_call_op *op) {
if (prepare_activate(calld, chand->active_child)) {
gpr_mu_unlock(&chand->mu);
/* activate the request (pass it down) outside the lock */
complete_activate(calld, chand->active_child, op);
complete_activate(elem, chand->active_child, op);
} else {
gpr_mu_unlock(&chand->mu);
}
@ -299,7 +305,7 @@ static void cancel_rpc(grpc_call_element *elem, grpc_call_op *op) {
case CALL_ACTIVE:
child_elem = grpc_call_stack_element(calld->s.active.child_stack, 0);
gpr_mu_unlock(&chand->mu);
child_elem->filter->call_op(child_elem, op);
child_elem->filter->call_op(child_elem, elem, op);
return; /* early out */
case CALL_WAITING:
remove_waiting_child(chand, calld);
@ -333,9 +339,9 @@ static void cancel_rpc(grpc_call_element *elem, grpc_call_op *op) {
abort();
}
static void call_op(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;
channel_data *chand = elem->channel_data;
grpc_call_element *child_elem;
GPR_ASSERT(elem->filter == &grpc_client_channel_filter);
GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
@ -350,7 +356,7 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
break;
case GRPC_SEND_START:
/* filter out the start event to find which child to send on */
start_rpc(calld, chand, op);
start_rpc(elem, op);
break;
case GRPC_CANCEL_OP:
cancel_rpc(elem, op);
@ -363,7 +369,7 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
case GRPC_CALL_DOWN:
child_elem = grpc_call_stack_element(calld->s.active.child_stack, 0);
GPR_ASSERT(calld->state == CALL_ACTIVE);
child_elem->filter->call_op(child_elem, op);
child_elem->filter->call_op(child_elem, elem, op);
break;
}
break;
@ -395,7 +401,7 @@ static void broadcast_channel_op_down(grpc_channel_element *elem,
if (op->type == GRPC_CHANNEL_GOAWAY) {
gpr_slice_ref(op->data.goaway.message);
}
child_elem->filter->channel_op(child_elem, op);
child_elem->filter->channel_op(child_elem, elem, op);
}
if (op->type == GRPC_CHANNEL_GOAWAY) {
gpr_slice_unref(op->data.goaway.message);
@ -411,7 +417,8 @@ static void broadcast_channel_op_down(grpc_channel_element *elem,
gpr_free(children);
}
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
GPR_ASSERT(elem->filter == &grpc_client_channel_filter);
switch (op->type) {
@ -627,7 +634,7 @@ grpc_transport_setup_result grpc_client_channel_transport_setup_complete(
that guarantee we need to do some curly locking here */
for (i = 0; i < waiting_child_count; i++) {
if (waiting_children[i]) {
complete_activate(waiting_children[i], child_ent, &call_ops[i]);
complete_activate(waiting_children[i]->elem, child_ent, &call_ops[i]);
}
}
gpr_free(waiting_children);

@ -113,7 +113,8 @@ static void end_bufferable_op(grpc_call_op *op, channel_data *chand,
/* Intercept a call operation and either push it directly up or translate it
into transport stream operations */
static void call_op(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;
channel_data *chand = elem->channel_data;
GPR_ASSERT(elem->filter == &grpc_connected_channel_filter);
@ -164,7 +165,8 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
}
/* Currently we assume all channel operations should just be pushed up. */
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
channel_data *chand = elem->channel_data;
GPR_ASSERT(elem->filter == &grpc_connected_channel_filter);
@ -282,7 +284,7 @@ static void accept_stream(void *user_data, grpc_transport *transport,
op.dir = GRPC_CALL_UP;
op.data.accept_call.transport = transport;
op.data.accept_call.transport_server_data = transport_server_data;
channel_op(elem, &op);
channel_op(elem, NULL, &op);
}
static void recv_error(channel_data *chand, call_data *calld, int line,
@ -481,7 +483,7 @@ static void transport_goaway(void *user_data, grpc_transport *transport,
op.dir = GRPC_CALL_UP;
op.data.goaway.status = status;
op.data.goaway.message = debug;
channel_op(elem, &op);
channel_op(elem, NULL, &op);
}
static void transport_closed(void *user_data, grpc_transport *transport) {
@ -495,7 +497,7 @@ static void transport_closed(void *user_data, grpc_transport *transport) {
op.type = GRPC_TRANSPORT_CLOSED;
op.dir = GRPC_CALL_UP;
channel_op(elem, &op);
channel_op(elem, NULL, &op);
}
const grpc_transport_callbacks connected_channel_transport_callbacks = {

@ -48,7 +48,8 @@ static void ignore_unused(void *ignored) {}
- a network event (or similar) from below, to receive something
op contains type and call direction information, in addition to the data
that is being sent or received. */
static void call_op(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) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
@ -71,7 +72,8 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
/* Called on special channel events, such as disconnection or new incoming
calls on the server */
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
/* grab pointers to our data from the channel element */
channel_data *channeld = elem->channel_data;

@ -50,7 +50,8 @@ static void ignore_unused(void *ignored) {}
- a network event (or similar) from below, to receive something
op contains type and call direction information, in addition to the data
that is being sent or received. */
static void call_op(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) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
@ -69,7 +70,8 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
/* Called on special channel events, such as disconnection or new incoming
calls on the server */
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
/* grab pointers to our data from the channel element */
channel_data *channeld = elem->channel_data;

@ -49,7 +49,8 @@ static void ignore_unused(void *ignored) {}
- a network event (or similar) from below, to receive something
op contains type and call direction information, in addition to the data
that is being sent or received. */
static void call_op(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) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
@ -97,7 +98,8 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
/* Called on special channel events, such as disconnection or new incoming
calls on the server */
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
/* grab pointers to our data from the channel element */
channel_data *channeld = elem->channel_data;

@ -50,7 +50,8 @@ static void ignore_unused(void *ignored) {}
- a network event (or similar) from below, to receive something
op contains type and call direction information, in addition to the data
that is being sent or received. */
static void call_op(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) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
@ -68,7 +69,8 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
/* Called on special channel events, such as disconnection or new incoming
calls on the server */
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
/* grab pointers to our data from the channel element */
channel_data *channeld = elem->channel_data;

@ -67,7 +67,8 @@ static void on_credentials_metadata(void *user_data, grpc_mdelem **md_elems,
- a network event (or similar) from below, to receive something
op contains type and call direction information, in addition to the data
that is being sent or received. */
static void call_op(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) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
@ -103,7 +104,8 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
/* Called on special channel events, such as disconnection or new incoming
calls on the server */
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
grpc_channel_next_op(elem, op);
}

@ -276,7 +276,7 @@ grpc_call_error grpc_call_cancel(grpc_call *c) {
op.user_data = NULL;
elem = CALL_ELEM_FROM_CALL(c, 0);
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
return GRPC_CALL_OK;
}
@ -285,7 +285,7 @@ void grpc_call_execute_op(grpc_call *call, grpc_call_op *op) {
grpc_call_element *elem;
GPR_ASSERT(op->dir == GRPC_CALL_DOWN);
elem = CALL_ELEM_FROM_CALL(call, 0);
elem->filter->call_op(elem, op);
elem->filter->call_op(elem, NULL, op);
}
grpc_call_error grpc_call_add_metadata(grpc_call *call, grpc_metadata *metadata,
@ -307,7 +307,7 @@ grpc_call_error grpc_call_add_metadata(grpc_call *call, grpc_metadata *metadata,
metadata->value_length);
elem = CALL_ELEM_FROM_CALL(call, 0);
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
return GRPC_CALL_OK;
}
@ -404,7 +404,7 @@ grpc_call_error grpc_call_start_invoke(grpc_call *call,
op.user_data = call;
elem = CALL_ELEM_FROM_CALL(call, 0);
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
return GRPC_CALL_OK;
}
@ -475,7 +475,7 @@ grpc_call_error grpc_call_server_end_initial_metadata(grpc_call *call,
op.user_data = NULL;
elem = CALL_ELEM_FROM_CALL(call, 0);
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
return GRPC_CALL_OK;
}
@ -542,7 +542,7 @@ static void request_more_data(grpc_call *call) {
op.user_data = NULL;
elem = CALL_ELEM_FROM_CALL(call, 0);
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
}
grpc_call_error grpc_call_start_read(grpc_call *call, void *tag) {
@ -630,7 +630,7 @@ grpc_call_error grpc_call_start_write(grpc_call *call,
op.data.message = byte_buffer;
elem = CALL_ELEM_FROM_CALL(call, 0);
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
return GRPC_CALL_OK;
}
@ -669,7 +669,7 @@ grpc_call_error grpc_call_writes_done(grpc_call *call, void *tag) {
op.user_data = call;
elem = CALL_ELEM_FROM_CALL(call, 0);
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
return GRPC_CALL_OK;
}
@ -709,7 +709,7 @@ grpc_call_error grpc_call_start_write_status(grpc_call *call,
op.done_cb = do_nothing;
op.user_data = NULL;
op.data.metadata = md;
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
}
/* always send status */
@ -726,7 +726,7 @@ grpc_call_error grpc_call_start_write_status(grpc_call *call,
op.done_cb = do_nothing;
op.user_data = NULL;
op.data.metadata = md;
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
}
grpc_cq_begin_op(call->cq, call, GRPC_FINISH_ACCEPTED);
@ -741,7 +741,7 @@ grpc_call_error grpc_call_start_write_status(grpc_call *call,
op.done_cb = done_writes_done;
op.user_data = call;
elem->filter->call_op(elem, &op);
elem->filter->call_op(elem, NULL, &op);
return GRPC_CALL_OK;
}

@ -133,11 +133,11 @@ void grpc_channel_destroy(grpc_channel *channel) {
op.dir = GRPC_CALL_DOWN;
op.data.goaway.status = GRPC_STATUS_OK;
op.data.goaway.message = gpr_slice_from_copied_string("Client disconnect");
elem->filter->channel_op(elem, &op);
elem->filter->channel_op(elem, NULL, &op);
op.type = GRPC_CHANNEL_DISCONNECT;
op.dir = GRPC_CALL_DOWN;
elem->filter->channel_op(elem, &op);
elem->filter->channel_op(elem, NULL, &op);
grpc_channel_internal_unref(channel);
}

@ -42,7 +42,8 @@ typedef struct { void *unused; } call_data;
typedef struct { void *unused; } channel_data;
static void call_op(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) {
GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
switch (op->type) {
@ -75,7 +76,8 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
}
}
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
switch (op->type) {
case GRPC_ACCEPT_CALL:
gpr_log(GPR_ERROR, "Client cannot accept new calls");

@ -44,7 +44,8 @@ typedef struct { void *unused; } call_data;
typedef struct { void *unused; } channel_data;
static void call_op(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) {
GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
switch (op->type) {
@ -61,7 +62,8 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
op->done_cb(op->user_data, GRPC_OP_ERROR);
}
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
switch (op->type) {
case GRPC_CHANNEL_GOAWAY:
gpr_slice_unref(op->data.goaway.message);

@ -276,7 +276,8 @@ static void finish_rpc(grpc_call_element *elem, int is_full_close) {
gpr_mu_unlock(&chand->server->mu);
}
static void call_op(grpc_call_element *elem, grpc_call_op *op) {
static void call_op(grpc_call_element *elem, grpc_call_element *from_elemn,
grpc_call_op *op) {
GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
switch (op->type) {
case GRPC_RECV_METADATA:
@ -306,7 +307,8 @@ static void call_op(grpc_call_element *elem, grpc_call_op *op) {
}
}
static void channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
channel_data *chand = elem->channel_data;
switch (op->type) {
@ -341,7 +343,7 @@ static void finish_shutdown_channel(void *cd, grpc_iomgr_cb_status status) {
op.dir = GRPC_CALL_DOWN;
channel_op(grpc_channel_stack_element(
grpc_channel_get_channel_stack(chand->channel), 0),
&op);
NULL, &op);
grpc_channel_internal_unref(chand->channel);
}
@ -558,7 +560,7 @@ void grpc_server_shutdown(grpc_server *server) {
op.dir = GRPC_CALL_DOWN;
op.data.goaway.status = GRPC_STATUS_OK;
op.data.goaway.message = gpr_slice_from_copied_string("Server shutdown");
elem->filter->channel_op(elem, &op);
elem->filter->channel_op(elem, NULL, &op);
grpc_channel_internal_unref(c->channel);
}

@ -66,11 +66,13 @@ static void call_destroy_func(grpc_call_element *elem) {
++*(int *)(elem->channel_data);
}
static void call_func(grpc_call_element *elem, grpc_call_op *op) {
static void call_func(grpc_call_element *elem, grpc_call_element *from_elem,
grpc_call_op *op) {
++*(int *)(elem->call_data);
}
static void channel_func(grpc_channel_element *elem, grpc_channel_op *op) {
static void channel_func(grpc_channel_element *elem,
grpc_channel_element *from_elem, grpc_channel_op *op) {
++*(int *)(elem->channel_data);
}

@ -61,10 +61,14 @@ typedef struct {
size_t value_prefix_len;
} channel_data;
static void fail_call_op(grpc_call_element *elem, grpc_call_op *op) { abort(); }
static void fail_call_op(grpc_call_element *elem, grpc_call_element *from_elem,
grpc_call_op *op) {
abort();
}
/* verify that the metadata passed on during flush is the same as we expect */
static void expect_call_op(grpc_call_element *elem, grpc_call_op *op) {
static void expect_call_op(grpc_call_element *elem,
grpc_call_element *from_elem, grpc_call_op *op) {
size_t *n = elem->call_data;
channel_data *cd = elem->channel_data;
gpr_slice key = construct_buffer(cd->key_prefix_len, *n);
@ -85,7 +89,9 @@ static void expect_call_op(grpc_call_element *elem, grpc_call_op *op) {
grpc_mdelem_unref(op->data.metadata);
}
static void fail_channel_op(grpc_channel_element *elem, grpc_channel_op *op) {
static void fail_channel_op(grpc_channel_element *elem,
grpc_channel_element *from_elem,
grpc_channel_op *op) {
abort();
}

Loading…
Cancel
Save