clang-format

pull/9949/head
Craig Tiller 8 years ago
parent a0f3abd925
commit e1b51dafb6
  1. 23
      src/core/ext/client_channel/client_channel.c
  2. 6
      src/core/ext/load_reporting/load_reporting_filter.c
  3. 6
      src/core/ext/transport/cronet/transport/cronet_transport.c
  4. 7
      src/core/lib/channel/channel_stack.h
  5. 6
      src/core/lib/channel/compress_filter.c
  6. 6
      src/core/lib/channel/connected_channel.c
  7. 15
      src/core/lib/channel/deadline_filter.c
  8. 6
      src/core/lib/channel/message_size_filter.c
  9. 6
      src/core/lib/surface/lame_client.c
  10. 6
      src/core/lib/transport/transport.c
  11. 3
      src/core/lib/transport/transport_impl.h
  12. 6
      src/core/lib/transport/transport_op_string.c
  13. 6
      test/core/end2end/tests/filter_causes_close.c

@ -775,7 +775,8 @@ grpc_subchannel_call *grpc_client_channel_get_subchannel_call(
return scc == CANCELLED_CALL ? NULL : scc; return scc == CANCELLED_CALL ? NULL : scc;
} }
static void add_waiting_locked(call_data *calld, grpc_transport_stream_op_batch *op) { static void add_waiting_locked(call_data *calld,
grpc_transport_stream_op_batch *op) {
GPR_TIMER_BEGIN("add_waiting_locked", 0); GPR_TIMER_BEGIN("add_waiting_locked", 0);
if (calld->waiting_ops_count == calld->waiting_ops_capacity) { if (calld->waiting_ops_count == calld->waiting_ops_capacity) {
calld->waiting_ops_capacity = GPR_MAX(3, 2 * calld->waiting_ops_capacity); calld->waiting_ops_capacity = GPR_MAX(3, 2 * calld->waiting_ops_capacity);
@ -1052,9 +1053,9 @@ static bool pick_subchannel_locked(
return false; return false;
} }
static void start_transport_stream_op_batch_locked_inner(grpc_exec_ctx *exec_ctx, static void start_transport_stream_op_batch_locked_inner(
grpc_transport_stream_op_batch *op, grpc_exec_ctx *exec_ctx, grpc_transport_stream_op_batch *op,
grpc_call_element *elem) { grpc_call_element *elem) {
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
grpc_subchannel_call *call; grpc_subchannel_call *call;
@ -1177,8 +1178,9 @@ static void on_complete(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
GRPC_ERROR_REF(error)); GRPC_ERROR_REF(error));
} }
static void start_transport_stream_op_batch_locked(grpc_exec_ctx *exec_ctx, void *arg, static void start_transport_stream_op_batch_locked(grpc_exec_ctx *exec_ctx,
grpc_error *error_ignored) { void *arg,
grpc_error *error_ignored) {
GPR_TIMER_BEGIN("start_transport_stream_op_batch_locked", 0); GPR_TIMER_BEGIN("start_transport_stream_op_batch_locked", 0);
grpc_transport_stream_op_batch *op = arg; grpc_transport_stream_op_batch *op = arg;
@ -1208,13 +1210,14 @@ static void start_transport_stream_op_batch_locked(grpc_exec_ctx *exec_ctx, void
We use double-checked locking to initially see if initialization has been We use double-checked locking to initially see if initialization has been
performed. If it has not, we acquire the combiner and perform initialization. performed. If it has not, we acquire the combiner and perform initialization.
If it has, we proceed on the fast path. */ If it has, we proceed on the fast path. */
static void cc_start_transport_stream_op_batch(grpc_exec_ctx *exec_ctx, static void cc_start_transport_stream_op_batch(
grpc_call_element *elem, grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_transport_stream_op_batch *op) { grpc_transport_stream_op_batch *op) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;
GRPC_CALL_LOG_OP(GPR_INFO, elem, op); GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem, op); grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem,
op);
/* try to (atomically) get the call */ /* try to (atomically) get the call */
grpc_subchannel_call *call = GET_CALL(calld); grpc_subchannel_call *call = GET_CALL(calld);
GPR_TIMER_BEGIN("cc_start_transport_stream_op_batch", 0); GPR_TIMER_BEGIN("cc_start_transport_stream_op_batch", 0);

@ -183,9 +183,9 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
*/ */
} }
static void lr_start_transport_stream_op_batch(grpc_exec_ctx *exec_ctx, static void lr_start_transport_stream_op_batch(
grpc_call_element *elem, grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_transport_stream_op_batch *op) { grpc_transport_stream_op_batch *op) {
GPR_TIMER_BEGIN("lr_start_transport_stream_op_batch", 0); GPR_TIMER_BEGIN("lr_start_transport_stream_op_batch", 0);
call_data *calld = elem->call_data; call_data *calld = elem->call_data;

@ -298,7 +298,8 @@ static grpc_error *make_error_with_desc(int error_code, const char *desc) {
/* /*
Add a new stream op to op storage. Add a new stream op to op storage.
*/ */
static void add_to_storage(struct stream_obj *s, grpc_transport_stream_op_batch *op) { static void add_to_storage(struct stream_obj *s,
grpc_transport_stream_op_batch *op) {
struct op_storage *storage = &s->storage; struct op_storage *storage = &s->storage;
/* add new op at the beginning of the linked list. The memory is freed /* add new op at the beginning of the linked list. The memory is freed
in remove_from_storage */ in remove_from_storage */
@ -1301,7 +1302,8 @@ static void set_pollset_set_do_nothing(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pollset_set) {} grpc_pollset_set *pollset_set) {}
static void perform_stream_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt, static void perform_stream_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
grpc_stream *gs, grpc_transport_stream_op_batch *op) { grpc_stream *gs,
grpc_transport_stream_op_batch *op) {
CRONET_LOG(GPR_DEBUG, "perform_stream_op"); CRONET_LOG(GPR_DEBUG, "perform_stream_op");
if (op->send_initial_metadata && if (op->send_initial_metadata &&
header_has_authority(op->payload->send_initial_metadata header_has_authority(op->payload->send_initial_metadata

@ -113,8 +113,8 @@ typedef struct {
/* Called to eg. send/receive data on a call. /* Called to eg. send/receive data on a call.
See grpc_call_next_op on how to call the next element in the stack */ See grpc_call_next_op on how to call the next element in the stack */
void (*start_transport_stream_op_batch)(grpc_exec_ctx *exec_ctx, void (*start_transport_stream_op_batch)(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem, grpc_call_element *elem,
grpc_transport_stream_op_batch *op); grpc_transport_stream_op_batch *op);
/* Called to handle channel level operations - e.g. new calls, or transport /* Called to handle channel level operations - e.g. new calls, or transport
closure. closure.
See grpc_channel_next_op on how to call the next element in the stack */ See grpc_channel_next_op on how to call the next element in the stack */
@ -300,7 +300,8 @@ grpc_channel_stack *grpc_channel_stack_from_top_element(
grpc_call_stack *grpc_call_stack_from_top_element(grpc_call_element *elem); grpc_call_stack *grpc_call_stack_from_top_element(grpc_call_element *elem);
void grpc_call_log_op(char *file, int line, gpr_log_severity severity, void grpc_call_log_op(char *file, int line, gpr_log_severity severity,
grpc_call_element *elem, grpc_transport_stream_op_batch *op); grpc_call_element *elem,
grpc_transport_stream_op_batch *op);
void grpc_call_element_signal_error(grpc_exec_ctx *exec_ctx, void grpc_call_element_signal_error(grpc_exec_ctx *exec_ctx,
grpc_call_element *cur_elem, grpc_call_element *cur_elem,

@ -243,9 +243,9 @@ static void continue_send_message(grpc_exec_ctx *exec_ctx,
} }
} }
static void compress_start_transport_stream_op_batch(grpc_exec_ctx *exec_ctx, static void compress_start_transport_stream_op_batch(
grpc_call_element *elem, grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_transport_stream_op_batch *op) { grpc_transport_stream_op_batch *op) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
GPR_TIMER_BEGIN("compress_start_transport_stream_op_batch", 0); GPR_TIMER_BEGIN("compress_start_transport_stream_op_batch", 0);

@ -62,9 +62,9 @@ typedef struct connected_channel_call_data { void *unused; } call_data;
/* Intercept a call operation and either push it directly up or translate it /* Intercept a call operation and either push it directly up or translate it
into transport stream operations */ into transport stream operations */
static void con_start_transport_stream_op_batch(grpc_exec_ctx *exec_ctx, static void con_start_transport_stream_op_batch(
grpc_call_element *elem, grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_transport_stream_op_batch *op) { grpc_transport_stream_op_batch *op) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data; channel_data *chand = elem->channel_data;
GRPC_CALL_LOG_OP(GPR_INFO, elem, op); GRPC_CALL_LOG_OP(GPR_INFO, elem, op);

@ -261,10 +261,11 @@ static void destroy_call_elem(grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
} }
// Method for starting a call op for client filter. // Method for starting a call op for client filter.
static void client_start_transport_stream_op_batch(grpc_exec_ctx* exec_ctx, static void client_start_transport_stream_op_batch(
grpc_call_element* elem, grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
grpc_transport_stream_op_batch* op) { grpc_transport_stream_op_batch* op) {
grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem, op); grpc_deadline_state_client_start_transport_stream_op_batch(exec_ctx, elem,
op);
// Chain to next filter. // Chain to next filter.
grpc_call_next_op(exec_ctx, elem, op); grpc_call_next_op(exec_ctx, elem, op);
} }
@ -282,9 +283,9 @@ static void recv_initial_metadata_ready(grpc_exec_ctx* exec_ctx, void* arg,
} }
// Method for starting a call op for server filter. // Method for starting a call op for server filter.
static void server_start_transport_stream_op_batch(grpc_exec_ctx* exec_ctx, static void server_start_transport_stream_op_batch(
grpc_call_element* elem, grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
grpc_transport_stream_op_batch* op) { grpc_transport_stream_op_batch* op) {
server_call_data* calld = elem->call_data; server_call_data* calld = elem->call_data;
if (op->cancel_stream) { if (op->cancel_stream) {
cancel_timer_if_needed(exec_ctx, &calld->base.deadline_state); cancel_timer_if_needed(exec_ctx, &calld->base.deadline_state);

@ -136,9 +136,9 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data,
} }
// Start transport stream op. // Start transport stream op.
static void start_transport_stream_op_batch(grpc_exec_ctx* exec_ctx, static void start_transport_stream_op_batch(
grpc_call_element* elem, grpc_exec_ctx* exec_ctx, grpc_call_element* elem,
grpc_transport_stream_op_batch* op) { grpc_transport_stream_op_batch* op) {
call_data* calld = elem->call_data; call_data* calld = elem->call_data;
// Check max send message size. // Check max send message size.
if (op->send_message && calld->max_send_size >= 0 && if (op->send_message && calld->max_send_size >= 0 &&

@ -80,9 +80,9 @@ static void fill_metadata(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
mdb->deadline = gpr_inf_future(GPR_CLOCK_REALTIME); mdb->deadline = gpr_inf_future(GPR_CLOCK_REALTIME);
} }
static void lame_start_transport_stream_op_batch(grpc_exec_ctx *exec_ctx, static void lame_start_transport_stream_op_batch(
grpc_call_element *elem, grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_transport_stream_op_batch *op) { grpc_transport_stream_op_batch *op) {
GRPC_CALL_LOG_OP(GPR_INFO, elem, op); GRPC_CALL_LOG_OP(GPR_INFO, elem, op);
if (op->recv_initial_metadata) { if (op->recv_initial_metadata) {
fill_metadata(exec_ctx, elem, fill_metadata(exec_ctx, elem,

@ -213,9 +213,9 @@ grpc_endpoint *grpc_transport_get_endpoint(grpc_exec_ctx *exec_ctx,
return transport->vtable->get_endpoint(exec_ctx, transport); return transport->vtable->get_endpoint(exec_ctx, transport);
} }
void grpc_transport_stream_op_batch_finish_with_failure(grpc_exec_ctx *exec_ctx, void grpc_transport_stream_op_batch_finish_with_failure(
grpc_transport_stream_op_batch *op, grpc_exec_ctx *exec_ctx, grpc_transport_stream_op_batch *op,
grpc_error *error) { grpc_error *error) {
if (op->recv_message) { if (op->recv_message) {
grpc_closure_sched(exec_ctx, op->payload->recv_message.recv_message_ready, grpc_closure_sched(exec_ctx, op->payload->recv_message.recv_message_ready,
GRPC_ERROR_REF(error)); GRPC_ERROR_REF(error));

@ -59,7 +59,8 @@ typedef struct grpc_transport_vtable {
/* implementation of grpc_transport_perform_stream_op */ /* implementation of grpc_transport_perform_stream_op */
void (*perform_stream_op)(grpc_exec_ctx *exec_ctx, grpc_transport *self, void (*perform_stream_op)(grpc_exec_ctx *exec_ctx, grpc_transport *self,
grpc_stream *stream, grpc_transport_stream_op_batch *op); grpc_stream *stream,
grpc_transport_stream_op_batch *op);
/* implementation of grpc_transport_perform_op */ /* implementation of grpc_transport_perform_op */
void (*perform_op)(grpc_exec_ctx *exec_ctx, grpc_transport *self, void (*perform_op)(grpc_exec_ctx *exec_ctx, grpc_transport *self,

@ -71,7 +71,8 @@ static void put_metadata_list(gpr_strvec *b, grpc_metadata_batch md) {
} }
} }
char *grpc_transport_stream_op_batch_string(grpc_transport_stream_op_batch *op) { char *grpc_transport_stream_op_batch_string(
grpc_transport_stream_op_batch *op) {
char *tmp; char *tmp;
char *out; char *out;
@ -208,7 +209,8 @@ char *grpc_transport_op_string(grpc_transport_op *op) {
} }
void grpc_call_log_op(char *file, int line, gpr_log_severity severity, void grpc_call_log_op(char *file, int line, gpr_log_severity severity,
grpc_call_element *elem, grpc_transport_stream_op_batch *op) { grpc_call_element *elem,
grpc_transport_stream_op_batch *op) {
char *str = grpc_transport_stream_op_batch_string(op); char *str = grpc_transport_stream_op_batch_string(op);
gpr_log(file, line, severity, "OP[%s:%p]: %s", elem->filter->name, elem, str); gpr_log(file, line, severity, "OP[%s:%p]: %s", elem->filter->name, elem, str);
gpr_free(str); gpr_free(str);

@ -216,9 +216,9 @@ static void recv_im_ready(grpc_exec_ctx *exec_ctx, void *arg,
GRPC_STATUS_PERMISSION_DENIED)); GRPC_STATUS_PERMISSION_DENIED));
} }
static void start_transport_stream_op_batch(grpc_exec_ctx *exec_ctx, static void start_transport_stream_op_batch(
grpc_call_element *elem, grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_transport_stream_op_batch *op) { grpc_transport_stream_op_batch *op) {
call_data *calld = elem->call_data; call_data *calld = elem->call_data;
if (op->recv_initial_metadata) { if (op->recv_initial_metadata) {
calld->recv_im_ready = calld->recv_im_ready =

Loading…
Cancel
Save