clang-format

pull/7970/head
Mark D. Roth 9 years ago
parent 6ad991783f
commit 932b10c75b
  1. 6
      src/core/ext/client_config/client_channel.c
  2. 6
      src/core/ext/lb_policy/grpclb/grpclb.c
  3. 6
      src/core/ext/lb_policy/pick_first/pick_first.c
  4. 6
      src/core/ext/lb_policy/round_robin/round_robin.c
  5. 11
      src/core/lib/channel/deadline_filter.c
  6. 2
      src/core/lib/channel/deadline_filter.h
  7. 9
      src/core/lib/iomgr/error.c
  8. 3
      src/core/lib/surface/call.c

@ -563,9 +563,9 @@ static bool pick_subchannel(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
cpa = closure->cb_arg; cpa = closure->cb_arg;
if (cpa->connected_subchannel == connected_subchannel) { if (cpa->connected_subchannel == connected_subchannel) {
cpa->connected_subchannel = NULL; cpa->connected_subchannel = NULL;
grpc_exec_ctx_sched(exec_ctx, cpa->on_ready, grpc_exec_ctx_sched(
GRPC_ERROR_CREATE_REFERENCING( exec_ctx, cpa->on_ready,
"Pick cancelled", &error, 1), NULL); GRPC_ERROR_CREATE_REFERENCING("Pick cancelled", &error, 1), NULL);
} }
} }
gpr_mu_unlock(&chand->mu); gpr_mu_unlock(&chand->mu);

@ -545,9 +545,9 @@ static void glb_cancel_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
grpc_polling_entity_del_from_pollset_set( grpc_polling_entity_del_from_pollset_set(
exec_ctx, pp->pollent, glb_policy->base.interested_parties); exec_ctx, pp->pollent, glb_policy->base.interested_parties);
*target = NULL; *target = NULL;
grpc_exec_ctx_sched(exec_ctx, &pp->wrapped_on_complete, grpc_exec_ctx_sched(
GRPC_ERROR_CREATE_REFERENCING( exec_ctx, &pp->wrapped_on_complete,
"Pick Cancelled", &error, 1), NULL); GRPC_ERROR_CREATE_REFERENCING("Pick Cancelled", &error, 1), NULL);
gpr_free(pp); gpr_free(pp);
} else { } else {
pp->next = glb_policy->pending_picks; pp->next = glb_policy->pending_picks;

@ -141,9 +141,9 @@ static void pf_cancel_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
grpc_polling_entity_del_from_pollset_set(exec_ctx, pp->pollent, grpc_polling_entity_del_from_pollset_set(exec_ctx, pp->pollent,
p->base.interested_parties); p->base.interested_parties);
*target = NULL; *target = NULL;
grpc_exec_ctx_sched(exec_ctx, pp->on_complete, grpc_exec_ctx_sched(
GRPC_ERROR_CREATE_REFERENCING( exec_ctx, pp->on_complete,
"Pick Cancelled", &error, 1), NULL); GRPC_ERROR_CREATE_REFERENCING("Pick Cancelled", &error, 1), NULL);
gpr_free(pp); gpr_free(pp);
} else { } else {
pp->next = p->pending_picks; pp->next = p->pending_picks;

@ -294,9 +294,9 @@ static void rr_cancel_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol,
grpc_polling_entity_del_from_pollset_set(exec_ctx, pp->pollent, grpc_polling_entity_del_from_pollset_set(exec_ctx, pp->pollent,
p->base.interested_parties); p->base.interested_parties);
*target = NULL; *target = NULL;
grpc_exec_ctx_sched(exec_ctx, pp->on_complete, grpc_exec_ctx_sched(
GRPC_ERROR_CREATE_REFERENCING( exec_ctx, pp->on_complete,
"Pick cancelled", &error, 1), NULL); GRPC_ERROR_CREATE_REFERENCING("Pick cancelled", &error, 1), NULL);
gpr_free(pp); gpr_free(pp);
} else { } else {
pp->next = p->pending_picks; pp->next = p->pending_picks;

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

@ -74,4 +74,4 @@ void grpc_deadline_state_client_start_transport_stream_op(
extern const grpc_channel_filter grpc_client_deadline_filter; extern const grpc_channel_filter grpc_client_deadline_filter;
extern const grpc_channel_filter grpc_server_deadline_filter; extern const grpc_channel_filter grpc_server_deadline_filter;
#endif // GRPC_CORE_LIB_CHANNEL_DEADLINE_FILTER_H #endif /* GRPC_CORE_LIB_CHANNEL_DEADLINE_FILTER_H */

@ -345,12 +345,10 @@ static grpc_error *recursively_find_error_with_status(grpc_error* error,
intptr_t key = 0; intptr_t key = 0;
while (true) { while (true) {
grpc_error *child_error = gpr_avl_get(error->errs, (void *)key++); grpc_error *child_error = gpr_avl_get(error->errs, (void *)key++);
if (child_error == NULL) if (child_error == NULL) break;
break;
grpc_error *result = grpc_error *result =
recursively_find_error_with_status(child_error, status); recursively_find_error_with_status(child_error, status);
if (result != NULL) if (result != NULL) return result;
return result;
} }
return NULL; return NULL;
} }
@ -359,8 +357,7 @@ void grpc_error_get_status(grpc_error *error, grpc_status_code *code,
const char **msg) { const char **msg) {
// Handle special errors via the static map. // Handle special errors via the static map.
for (size_t i = 0; for (size_t i = 0;
i < sizeof(error_status_map) / sizeof(special_error_status_map); i < sizeof(error_status_map) / sizeof(special_error_status_map); ++i) {
++i) {
if (error == error_status_map[i].error) { if (error == error_status_map[i].error) {
*code = error_status_map[i].code; *code = error_status_map[i].code;
*msg = error_status_map[i].msg; *msg = error_status_map[i].msg;

@ -253,8 +253,7 @@ grpc_call *grpc_call_create(
call->metadata_batch[i][j].deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); call->metadata_batch[i][j].deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
} }
} }
send_deadline = send_deadline = gpr_convert_clock_type(send_deadline, GPR_CLOCK_MONOTONIC);
gpr_convert_clock_type(send_deadline, GPR_CLOCK_MONOTONIC);
GRPC_CHANNEL_INTERNAL_REF(channel, "call"); GRPC_CHANNEL_INTERNAL_REF(channel, "call");
/* initial refcount dropped by grpc_call_destroy */ /* initial refcount dropped by grpc_call_destroy */
grpc_error *error = grpc_call_stack_init( grpc_error *error = grpc_call_stack_init(

Loading…
Cancel
Save