clang-format

pull/7395/head
Mark D. Roth 8 years ago
parent 9317715338
commit b3ce178b28
  1. 9
      src/core/ext/transport/chttp2/client/insecure/channel_create.c
  2. 22
      src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
  3. 6
      src/core/ext/transport/chttp2/server/insecure/server_chttp2.c
  4. 4
      src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c
  5. 14
      src/core/lib/channel/handshaker.c
  6. 11
      src/core/lib/channel/handshaker.h

@ -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));

@ -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));

@ -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));

@ -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()

@ -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

@ -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 */

Loading…
Cancel
Save