diff --git a/src/core/surface/call.c b/src/core/surface/call.c index e3fd7d564a2..73c19969081 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -1068,7 +1068,7 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp, if (call->receiving_stream == NULL) { *call->receiving_buffer = NULL; - call->receiving_message = 0; + call->receiving_message = 0; if (gpr_unref(&bctl->steps_to_complete)) { post_batch_completion(exec_ctx, bctl); } @@ -1079,7 +1079,7 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp, grpc_byte_stream_destroy(exec_ctx, call->receiving_stream); call->receiving_stream = NULL; *call->receiving_buffer = NULL; - call->receiving_message = 0; + call->receiving_message = 0; if (gpr_unref(&bctl->steps_to_complete)) { post_batch_completion(exec_ctx, bctl); } diff --git a/src/core/transport/byte_stream.c b/src/core/transport/byte_stream.c index 4e8f5896230..89e20489e7f 100644 --- a/src/core/transport/byte_stream.c +++ b/src/core/transport/byte_stream.c @@ -44,7 +44,8 @@ int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx, on_complete); } -void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) { +void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream) { byte_stream->destroy(exec_ctx, byte_stream); } @@ -61,7 +62,8 @@ static int slice_buffer_stream_next(grpc_exec_ctx *exec_ctx, return 1; } -static void slice_buffer_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) {} +static void slice_buffer_stream_destroy(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream) {} void grpc_slice_buffer_stream_init(grpc_slice_buffer_stream *stream, gpr_slice_buffer *slice_buffer, diff --git a/src/core/transport/byte_stream.h b/src/core/transport/byte_stream.h index 558147f6f0a..5f2fe573e89 100644 --- a/src/core/transport/byte_stream.h +++ b/src/core/transport/byte_stream.h @@ -72,7 +72,8 @@ int grpc_byte_stream_next(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream, gpr_slice *slice, size_t max_size_hint, grpc_closure *on_complete); -void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream); +void grpc_byte_stream_destroy(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream); /* grpc_byte_stream that wraps a slice buffer */ typedef struct grpc_slice_buffer_stream { diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 4d1a5d9bcf5..3bb23ff03fe 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -139,7 +139,7 @@ static void incoming_byte_stream_update_flow_control( grpc_chttp2_stream_global *stream_global, size_t max_size_hint, size_t have_already); -static void fail_pending_writes(grpc_exec_ctx *exec_ctx, +static void fail_pending_writes(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream_global *stream_global); /* @@ -647,7 +647,8 @@ void grpc_chttp2_terminate_writing(grpc_exec_ctx *exec_ctx, grpc_chttp2_cleanup_writing(exec_ctx, &t->global, &t->writing); - while (grpc_chttp2_list_pop_closed_waiting_for_writing(&t->global, &stream_global)) { + while (grpc_chttp2_list_pop_closed_waiting_for_writing(&t->global, + &stream_global)) { fail_pending_writes(exec_ctx, stream_global); GRPC_CHTTP2_STREAM_UNREF(exec_ctx, stream_global, "finish_writes"); } @@ -875,7 +876,9 @@ static void perform_stream_op_locked( if (stream_global->id != 0 && (stream_global->incoming_frames.head == NULL || stream_global->incoming_frames.head->is_tail)) { - incoming_byte_stream_update_flow_control(transport_global, stream_global, transport_global->stream_lookahead, 0); + incoming_byte_stream_update_flow_control( + transport_global, stream_global, transport_global->stream_lookahead, + 0); } grpc_chttp2_list_add_check_read_ops(transport_global, stream_global); } @@ -1132,7 +1135,7 @@ void grpc_chttp2_fake_status(grpc_exec_ctx *exec_ctx, } } -static void fail_pending_writes(grpc_exec_ctx *exec_ctx, +static void fail_pending_writes(grpc_exec_ctx *exec_ctx, grpc_chttp2_stream_global *stream_global) { grpc_chttp2_complete_closure_step( exec_ctx, &stream_global->send_initial_metadata_finished, 0); @@ -1538,7 +1541,8 @@ static void incoming_byte_stream_unref(grpc_chttp2_incoming_byte_stream *bs) { } } -static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, grpc_byte_stream *byte_stream) { +static void incoming_byte_stream_destroy(grpc_exec_ctx *exec_ctx, + grpc_byte_stream *byte_stream) { incoming_byte_stream_unref((grpc_chttp2_incoming_byte_stream *)byte_stream); } diff --git a/test/core/bad_client/tests/window_overflow.c b/test/core/bad_client/tests/window_overflow.c index 37a32282851..1c898f352da 100644 --- a/test/core/bad_client/tests/window_overflow.c +++ b/test/core/bad_client/tests/window_overflow.c @@ -52,11 +52,13 @@ "\x10\x0c" \ "content-type\x10" \ "application/grpc" \ - "\x10\x14grpc-accept-encoding\x15""deflate,identity,gzip" \ + "\x10\x14grpc-accept-encoding\x15" \ + "deflate,identity,gzip" \ "\x10\x02te\x08trailers" \ "\x10\x0auser-agent\"bad-client grpc-c/0.12.0.0 (linux)" -static void verifier(grpc_server *server, grpc_completion_queue *cq, void *registered_method) { +static void verifier(grpc_server *server, grpc_completion_queue *cq, + void *registered_method) { while (grpc_server_has_open_connections(server)) { GPR_ASSERT(grpc_completion_queue_next(cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(20), @@ -80,28 +82,20 @@ static void addbuf(const void *data, size_t len) { int main(int argc, char **argv) { int i, j; #define MAX_FRAME_SIZE 16384 -#define MESSAGES_PER_FRAME (MAX_FRAME_SIZE/5) -#define FRAME_SIZE (MESSAGES_PER_FRAME*5) -#define SEND_SIZE (100*1024) +#define MESSAGES_PER_FRAME (MAX_FRAME_SIZE / 5) +#define FRAME_SIZE (MESSAGES_PER_FRAME * 5) +#define SEND_SIZE (100 * 1024) #define NUM_FRAMES (SEND_SIZE / FRAME_SIZE + 1) grpc_test_init(argc, argv); addbuf(PFX_STR, sizeof(PFX_STR) - 1); for (i = 0; i < NUM_FRAMES; i++) { - gpr_uint8 hdr[9] = { - (gpr_uint8)(FRAME_SIZE >> 16), - (gpr_uint8)(FRAME_SIZE >> 8), - (gpr_uint8)FRAME_SIZE, - 0, - 0, - 0, - 0, - 0, - 1 - }; + gpr_uint8 hdr[9] = {(gpr_uint8)(FRAME_SIZE >> 16), + (gpr_uint8)(FRAME_SIZE >> 8), (gpr_uint8)FRAME_SIZE, 0, + 0, 0, 0, 0, 1}; addbuf(hdr, sizeof(hdr)); for (j = 0; j < MESSAGES_PER_FRAME; j++) { - gpr_uint8 message[5] = {0,0,0,0,0}; + gpr_uint8 message[5] = {0, 0, 0, 0, 0}; addbuf(message, sizeof(message)); } } diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c index 54ac6d0e1c0..08ab482c58f 100644 --- a/test/core/bad_ssl/bad_ssl_test.c +++ b/test/core/bad_ssl/bad_ssl_test.c @@ -163,7 +163,7 @@ int main(int argc, char **argv) { grpc_shutdown(); } gpr_free(args[2]); - + gpr_subprocess_interrupt(svr); status = gpr_subprocess_join(svr); gpr_subprocess_destroy(svr); diff --git a/test/core/bad_ssl/server.c b/test/core/bad_ssl/server.c index 2ed94de0994..6113d364c9d 100644 --- a/test/core/bad_ssl/server.c +++ b/test/core/bad_ssl/server.c @@ -74,9 +74,8 @@ void bad_ssl_run(grpc_server *server) { grpc_server_register_completion_queue(server, cq, NULL); grpc_server_start(server); - error = - grpc_server_request_call(server, &s, &call_details, - &request_metadata_recv, cq, cq, (void*)1); + error = grpc_server_request_call(server, &s, &call_details, + &request_metadata_recv, cq, cq, (void *)1); GPR_ASSERT(GRPC_CALL_OK == error); signal(SIGINT, sigint_handler); @@ -96,7 +95,7 @@ void bad_ssl_run(grpc_server *server) { NULL); switch (ev.type) { case GRPC_OP_COMPLETE: - GPR_ASSERT(ev.tag == (void*)1); + GPR_ASSERT(ev.tag == (void *)1); GPR_ASSERT(ev.success == 0); break; case GRPC_QUEUE_SHUTDOWN: diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c index c088fe2c09f..5f6166cbb53 100644 --- a/test/core/client_config/lb_policies_test.c +++ b/test/core/client_config/lb_policies_test.c @@ -137,9 +137,8 @@ static void kill_server(const servers_fixture *f, size_t i) { gpr_log(GPR_INFO, "KILLING SERVER %d", i); GPR_ASSERT(f->servers[i] != NULL); grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); - GPR_ASSERT( - grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000), NULL) - .type == GRPC_OP_COMPLETE); + GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000), n_millis_time(5000), + NULL).type == GRPC_OP_COMPLETE); grpc_server_destroy(f->servers[i]); f->servers[i] = NULL; } @@ -205,8 +204,8 @@ static void teardown_servers(servers_fixture *f) { if (f->servers[i] == NULL) continue; grpc_server_shutdown_and_notify(f->servers[i], f->cq, tag(10000)); GPR_ASSERT(grpc_completion_queue_pluck(f->cq, tag(10000), - n_millis_time(5000), NULL) - .type == GRPC_OP_COMPLETE); + n_millis_time(5000), + NULL).type == GRPC_OP_COMPLETE); grpc_server_destroy(f->servers[i]); } grpc_completion_queue_shutdown(f->cq); @@ -304,8 +303,8 @@ static int *perform_request(servers_fixture *f, grpc_channel *client, s_idx = -1; while ((ev = grpc_completion_queue_next( - f->cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), NULL)) - .type != GRPC_QUEUE_TIMEOUT) { + f->cq, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1), NULL)).type != + GRPC_QUEUE_TIMEOUT) { GPR_ASSERT(ev.type == GRPC_OP_COMPLETE); read_tag = ((int)(gpr_intptr)ev.tag); gpr_log(GPR_DEBUG, "EVENT: success:%d, type:%d, tag:%d iter:%d", @@ -377,8 +376,9 @@ static int *perform_request(servers_fixture *f, grpc_channel *client, } } - GPR_ASSERT(grpc_completion_queue_next( - f->cq, GRPC_TIMEOUT_MILLIS_TO_DEADLINE(200), NULL).type == GRPC_QUEUE_TIMEOUT); + GPR_ASSERT(grpc_completion_queue_next(f->cq, + GRPC_TIMEOUT_MILLIS_TO_DEADLINE(200), + NULL).type == GRPC_QUEUE_TIMEOUT); grpc_metadata_array_destroy(&rdata->initial_metadata_recv); grpc_metadata_array_destroy(&rdata->trailing_metadata_recv); @@ -800,7 +800,8 @@ static void verify_rebirth_round_robin(const servers_fixture *f, const size_t expected_seq_length = f->num_servers; int *seen_elements; - dump_array("actual_connection_sequence", actual_connection_sequence, num_iters); + dump_array("actual_connection_sequence", actual_connection_sequence, + num_iters); /* verify conn. seq. expectation */ /* get the first unique run of length "num_servers". */