Fix call data init in census grpc filter.

pull/3816/head
Hongyu Chen 9 years ago
parent bee8f104c0
commit 738e91e8d1
  1. 2
      src/core/census/grpc_filter.c

@ -132,6 +132,7 @@ static void client_init_call_elem(grpc_exec_ctx *exec_ctx,
grpc_transport_stream_op *initial_op) { grpc_transport_stream_op *initial_op) {
call_data *d = elem->call_data; call_data *d = elem->call_data;
GPR_ASSERT(d != NULL); GPR_ASSERT(d != NULL);
memset(d, 0, sizeof(*d));
d->start_ts = gpr_now(GPR_CLOCK_REALTIME); d->start_ts = gpr_now(GPR_CLOCK_REALTIME);
if (initial_op) client_mutate_op(elem, initial_op); if (initial_op) client_mutate_op(elem, initial_op);
} }
@ -149,6 +150,7 @@ static void server_init_call_elem(grpc_exec_ctx *exec_ctx,
grpc_transport_stream_op *initial_op) { grpc_transport_stream_op *initial_op) {
call_data *d = elem->call_data; call_data *d = elem->call_data;
GPR_ASSERT(d != NULL); GPR_ASSERT(d != NULL);
memset(d, 0, sizeof(*d));
d->start_ts = gpr_now(GPR_CLOCK_REALTIME); d->start_ts = gpr_now(GPR_CLOCK_REALTIME);
/* TODO(hongyu): call census_tracing_start_op here. */ /* TODO(hongyu): call census_tracing_start_op here. */
grpc_closure_init(d->on_done_recv, server_on_done_recv, elem); grpc_closure_init(d->on_done_recv, server_on_done_recv, elem);

Loading…
Cancel
Save