From fa4f99404f083ecd6416cc35b97de6a6522f0569 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 23 Apr 2015 15:22:09 -0700 Subject: [PATCH] Add init/destroy, and a debug-only assert on bad headers --- src/core/surface/call.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 5b8a985142d..556a3b600ea 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -287,6 +287,7 @@ grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq, call->metadata_context = grpc_channel_get_metadata_context(channel); grpc_sopb_init(&call->send_ops); grpc_sopb_init(&call->recv_ops); + gpr_slice_buffer_init(&call->incoming_message); /* one ref is dropped in response to destroy, the other in stream_closed */ gpr_ref_init(&call->internal_refcount, 2); @@ -348,6 +349,7 @@ static void destroy_call(void *call, int ignored_success) { grpc_bbq_destroy(&c->incoming_queue); grpc_sopb_destroy(&c->send_ops); grpc_sopb_destroy(&c->recv_ops); + gpr_slice_buffer_destroy(&c->incoming_message); gpr_free(c); } @@ -1028,6 +1030,7 @@ static void call_alarm(void *arg, int success) { static void set_deadline_alarm(grpc_call *call, gpr_timespec deadline) { if (call->have_alarm) { gpr_log(GPR_ERROR, "Attempt to set deadline alarm twice"); + assert(0); return; } grpc_call_internal_ref(call);