|
|
|
@ -54,9 +54,8 @@ static void timer_callback(grpc_exec_ctx *exec_ctx, void *arg, |
|
|
|
|
gpr_mu_unlock(&deadline_state->timer_mu); |
|
|
|
|
if (error != GRPC_ERROR_CANCELLED) { |
|
|
|
|
gpr_slice msg = gpr_slice_from_static_string("Deadline Exceeded"); |
|
|
|
|
grpc_call_element_send_cancel_with_message(exec_ctx, elem, |
|
|
|
|
GRPC_STATUS_DEADLINE_EXCEEDED, |
|
|
|
|
&msg); |
|
|
|
|
grpc_call_element_send_cancel_with_message( |
|
|
|
|
exec_ctx, elem, GRPC_STATUS_DEADLINE_EXCEEDED, &msg); |
|
|
|
|
gpr_slice_unref(msg); |
|
|
|
|
} |
|
|
|
|
GRPC_CALL_STACK_UNREF(exec_ctx, deadline_state->call_stack, "deadline_timer"); |
|
|
|
@ -159,8 +158,7 @@ static void init_channel_elem(grpc_exec_ctx* exec_ctx, |
|
|
|
|
|
|
|
|
|
// Destructor for channel_data. Used for both client and server filters.
|
|
|
|
|
static void destroy_channel_elem(grpc_exec_ctx* exec_ctx, |
|
|
|
|
grpc_channel_element* elem) { |
|
|
|
|
} |
|
|
|
|
grpc_channel_element* elem) {} |
|
|
|
|
|
|
|
|
|
// Call data used for both client and server filter.
|
|
|
|
|
typedef struct base_call_data { |
|
|
|
@ -213,8 +211,7 @@ static void recv_initial_metadata_ready(grpc_exec_ctx *exec_ctx, void *arg, |
|
|
|
|
grpc_call_element* elem = arg; |
|
|
|
|
server_call_data* calld = elem->call_data; |
|
|
|
|
// Get deadline from metadata and start the timer if needed.
|
|
|
|
|
start_timer_if_needed(exec_ctx, elem, |
|
|
|
|
calld->recv_initial_metadata->deadline); |
|
|
|
|
start_timer_if_needed(exec_ctx, elem, calld->recv_initial_metadata->deadline); |
|
|
|
|
// Invoke the next callback.
|
|
|
|
|
calld->next_recv_initial_metadata_ready->cb( |
|
|
|
|
exec_ctx, calld->next_recv_initial_metadata_ready->cb_arg, error); |
|
|
|
|