diff options
Diffstat (limited to 'src/core/surface')
-rw-r--r-- | src/core/surface/call.c | 2 | ||||
-rw-r--r-- | src/core/surface/client.c | 2 | ||||
-rw-r--r-- | src/core/surface/lame_client.c | 6 | ||||
-rw-r--r-- | src/core/surface/server.c | 11 |
4 files changed, 15 insertions, 6 deletions
diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 18be81308d..c39e6cf3a4 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -288,7 +288,7 @@ grpc_call *grpc_call_create(grpc_channel *channel, grpc_completion_queue *cq, /* one ref is dropped in response to destroy, the other in stream_closed */ gpr_ref_init(&call->internal_refcount, 2); - grpc_call_stack_init(channel_stack, server_transport_data, + grpc_call_stack_init(channel_stack, server_transport_data, NULL, CALL_STACK_FROM_CALL(call)); if (gpr_time_cmp(send_deadline, gpr_inf_future) != 0) { set_deadline_alarm(call, send_deadline); diff --git a/src/core/surface/client.c b/src/core/surface/client.c index 4669c59ee4..7eb99895f7 100644 --- a/src/core/surface/client.c +++ b/src/core/surface/client.c @@ -67,7 +67,7 @@ static void channel_op(grpc_channel_element *elem, } static void init_call_elem(grpc_call_element *elem, - const void *transport_server_data) {} + const void *transport_server_data, grpc_transport_op *initial_op) {} static void destroy_call_elem(grpc_call_element *elem) {} diff --git a/src/core/surface/lame_client.c b/src/core/surface/lame_client.c index 4e9eb808d7..f95e2a16c2 100644 --- a/src/core/surface/lame_client.c +++ b/src/core/surface/lame_client.c @@ -66,7 +66,11 @@ static void channel_op(grpc_channel_element *elem, } static void init_call_elem(grpc_call_element *elem, - const void *transport_server_data) {} + const void *transport_server_data, grpc_transport_op *initial_op) { + if (initial_op) { + grpc_transport_op_finish_with_failure(initial_op); + } +} static void destroy_call_elem(grpc_call_element *elem) {} diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 82d1323a4b..e9d6f86734 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -439,9 +439,8 @@ static void server_on_recv(void *ptr, int success) { calld->on_done_recv(calld->recv_user_data, success); } -static void server_start_transport_op(grpc_call_element *elem, grpc_transport_op *op) { +static void server_mutate_op(grpc_call_element *elem, grpc_transport_op *op) { call_data *calld = elem->call_data; - GRPC_CALL_LOG_OP(GPR_INFO, elem, op); if (op->recv_ops) { /* substitute our callback for the higher callback */ @@ -452,7 +451,11 @@ static void server_start_transport_op(grpc_call_element *elem, grpc_transport_op op->on_done_recv = server_on_recv; op->recv_user_data = elem; } +} +static void server_start_transport_op(grpc_call_element *elem, grpc_transport_op *op) { + GRPC_CALL_LOG_OP(GPR_INFO, elem, op); + server_mutate_op(elem, op); grpc_call_next_op(elem, op); } @@ -504,7 +507,7 @@ static void shutdown_channel(channel_data *chand) { } static void init_call_elem(grpc_call_element *elem, - const void *server_transport_data) { + const void *server_transport_data, grpc_transport_op *initial_op) { call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; memset(calld, 0, sizeof(call_data)); @@ -516,6 +519,8 @@ static void init_call_elem(grpc_call_element *elem, gpr_mu_unlock(&chand->server->mu); server_ref(chand->server); + + server_mutate_op(elem, initial_op); } static void destroy_call_elem(grpc_call_element *elem) { |