From b3ce178b28ebb842408f8cdc5b116816a0171095 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 20 Jul 2016 09:25:25 -0700 Subject: [PATCH] clang-format --- .../chttp2/client/insecure/channel_create.c | 9 ++++---- .../client/secure/secure_channel_create.c | 22 +++++++++---------- .../chttp2/server/insecure/server_chttp2.c | 6 ++--- .../server/secure/server_secure_chttp2.c | 4 ++-- src/core/lib/channel/handshaker.c | 14 +++++------- src/core/lib/channel/handshaker.h | 11 ++++------ 6 files changed, 28 insertions(+), 38 deletions(-) diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c index 154c4493ffc..162cc6bd6ab 100644 --- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c +++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c @@ -88,7 +88,7 @@ static void on_initial_connect_string_sent(grpc_exec_ctx *exec_ctx, void *arg, } static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint, - grpc_channel_args* args, void *user_data) { + grpc_channel_args *args, void *user_data) { connector *c = user_data; c->result->transport = grpc_create_chttp2_transport(exec_ctx, args, endpoint, 1); @@ -114,10 +114,9 @@ static void connected(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { grpc_endpoint_write(exec_ctx, tcp, &c->initial_string_buffer, &c->initial_string_sent); } else { - grpc_handshake_manager_do_handshake(exec_ctx, c->handshake_mgr, tcp, - c->args.channel_args, - c->args.deadline, on_handshake_done, - c); + grpc_handshake_manager_do_handshake( + exec_ctx, c->handshake_mgr, tcp, c->args.channel_args, + c->args.deadline, on_handshake_done, c); } } else { memset(c->result, 0, sizeof(*c->result)); diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c index 4554c33c8c6..dde35f253dd 100644 --- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c @@ -74,7 +74,7 @@ typedef struct { grpc_handshake_manager *handshake_mgr; // TODO(roth): Remove once we eliminate on_secure_handshake_done(). - grpc_channel_args* tmp_args; + grpc_channel_args *tmp_args; } connector; static void connector_ref(grpc_connector *con) { @@ -117,8 +117,8 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, grpc_chttp2_transport_start_reading(exec_ctx, c->result->transport, NULL, 0); auth_context_arg = grpc_auth_context_to_arg(auth_context); - c->result->channel_args = grpc_channel_args_copy_and_add( - c->tmp_args, &auth_context_arg, 1); + c->result->channel_args = + grpc_channel_args_copy_and_add(c->tmp_args, &auth_context_arg, 1); } grpc_closure *notify = c->notify; c->notify = NULL; @@ -126,7 +126,7 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, } static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint, - grpc_channel_args* args, void *user_data) { + grpc_channel_args *args, void *user_data) { connector *c = user_data; // TODO(roth, jboeuf): Convert security connector handshaking to use new // handshake API, and then move the code from on_secure_handshake_done() @@ -140,10 +140,9 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint, static void on_initial_connect_string_sent(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { connector *c = arg; - grpc_handshake_manager_do_handshake(exec_ctx, c->handshake_mgr, - c->connecting_endpoint, - c->args.channel_args, c->args.deadline, - on_handshake_done, c); + grpc_handshake_manager_do_handshake( + exec_ctx, c->handshake_mgr, c->connecting_endpoint, c->args.channel_args, + c->args.deadline, on_handshake_done, c); } static void connected(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { @@ -163,10 +162,9 @@ static void connected(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { grpc_endpoint_write(exec_ctx, tcp, &c->initial_string_buffer, &c->initial_string_sent); } else { - grpc_handshake_manager_do_handshake(exec_ctx, c->handshake_mgr, tcp, - c->args.channel_args, - c->args.deadline, on_handshake_done, - c); + grpc_handshake_manager_do_handshake( + exec_ctx, c->handshake_mgr, tcp, c->args.channel_args, + c->args.deadline, on_handshake_done, c); } } else { memset(c->result, 0, sizeof(*c->result)); diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c index 920875f6947..b8d816c1279 100644 --- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c +++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2.c @@ -55,7 +55,7 @@ typedef struct server_connect_state { } server_connect_state; static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint, - grpc_channel_args* args, void *user_data) { + grpc_channel_args *args, void *user_data) { server_connect_state *state = user_data; /* * Beware that the call to grpc_create_chttp2_transport() has to happen before @@ -64,8 +64,8 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint, * (as in server_secure_chttp2.c) needs to add synchronization to avoid this * case. */ - grpc_transport *transport = grpc_create_chttp2_transport( - exec_ctx, args, endpoint, 0); + grpc_transport *transport = + grpc_create_chttp2_transport(exec_ctx, args, endpoint, 0); grpc_server_setup_transport(exec_ctx, state->server, transport, state->accepting_pollset, grpc_server_get_channel_args(state->server)); diff --git a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c index e3184bc1f93..bc714f4e5bc 100644 --- a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +++ b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c @@ -74,7 +74,7 @@ typedef struct server_secure_connect { // TODO(roth): Remove the following two fields when we eliminate // grpc_server_security_connector_do_handshake(). gpr_timespec deadline; - grpc_channel_args* args; + grpc_channel_args *args; } server_secure_connect; static void state_ref(server_secure_state *state) { gpr_ref(&state->refcount); } @@ -129,7 +129,7 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *statep, } static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint, - grpc_channel_args* args, void *user_data) { + grpc_channel_args *args, void *user_data) { server_secure_connect *state = user_data; // TODO(roth, jboeuf): Convert security connector handshaking to use new // handshake API, and then move the code from on_secure_handshake_done() diff --git a/src/core/lib/channel/handshaker.c b/src/core/lib/channel/handshaker.c index 7dcbe1df9ce..9191ae63395 100644 --- a/src/core/lib/channel/handshaker.c +++ b/src/core/lib/channel/handshaker.c @@ -129,8 +129,7 @@ void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx, // handshakers together. static void call_next_handshaker(grpc_exec_ctx* exec_ctx, grpc_endpoint* endpoint, - grpc_channel_args* args, - void* user_data) { + grpc_channel_args* args, void* user_data) { grpc_handshake_manager* mgr = user_data; GPR_ASSERT(mgr->state != NULL); GPR_ASSERT(mgr->state->index < mgr->count); @@ -153,13 +152,10 @@ static void call_next_handshaker(grpc_exec_ctx* exec_ctx, } } -void grpc_handshake_manager_do_handshake(grpc_exec_ctx* exec_ctx, - grpc_handshake_manager* mgr, - grpc_endpoint* endpoint, - const grpc_channel_args* args, - gpr_timespec deadline, - grpc_handshaker_done_cb cb, - void* user_data) { +void grpc_handshake_manager_do_handshake( + grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr, + grpc_endpoint* endpoint, const grpc_channel_args* args, + gpr_timespec deadline, grpc_handshaker_done_cb cb, void* user_data) { grpc_channel_args* args_copy = grpc_channel_args_copy(args); if (mgr->count == 0) { // No handshakers registered, so we just immediately call the done diff --git a/src/core/lib/channel/handshaker.h b/src/core/lib/channel/handshaker.h index 6a39529150a..b8aa78c2454 100644 --- a/src/core/lib/channel/handshaker.h +++ b/src/core/lib/channel/handshaker.h @@ -131,12 +131,9 @@ void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx, /// invoking the first handshaker. /// If successful, invokes \a cb with \a user_data after all handshakers /// have completed. -void grpc_handshake_manager_do_handshake(grpc_exec_ctx* exec_ctx, - grpc_handshake_manager* mgr, - grpc_endpoint* endpoint, - const grpc_channel_args* args, - gpr_timespec deadline, - grpc_handshaker_done_cb cb, - void* user_data); +void grpc_handshake_manager_do_handshake( + grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr, + grpc_endpoint* endpoint, const grpc_channel_args* args, + gpr_timespec deadline, grpc_handshaker_done_cb cb, void* user_data); #endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */