aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lib/channel/handshaker.c33
-rw-r--r--src/core/lib/channel/handshaker.h39
2 files changed, 37 insertions, 35 deletions
diff --git a/src/core/lib/channel/handshaker.c b/src/core/lib/channel/handshaker.c
index 3018b95464..65c2a96df7 100644
--- a/src/core/lib/channel/handshaker.c
+++ b/src/core/lib/channel/handshaker.c
@@ -52,12 +52,13 @@ void grpc_handshaker_shutdown(grpc_exec_ctx* exec_ctx,
handshaker->vtable->shutdown(exec_ctx, handshaker);
}
-void grpc_handshaker_do_handshake(
- grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker,
- grpc_endpoint* endpoint, gpr_timespec deadline,
- grpc_handshaker_done_cb cb, void* arg) {
- handshaker->vtable->do_handshake(exec_ctx, handshaker, endpoint,
- deadline, cb, arg);
+void grpc_handshaker_do_handshake(grpc_exec_ctx* exec_ctx,
+ grpc_handshaker* handshaker,
+ grpc_endpoint* endpoint,
+ gpr_timespec deadline,
+ grpc_handshaker_done_cb cb, void* arg) {
+ handshaker->vtable->do_handshake(exec_ctx, handshaker, endpoint, deadline, cb,
+ arg);
}
//
@@ -96,16 +97,16 @@ void grpc_handshake_manager_add(grpc_handshaker* handshaker,
mgr->handshakers[mgr->count++] = handshaker;
}
-void grpc_handshake_manager_destroy(
- grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr) {
+void grpc_handshake_manager_destroy(grpc_exec_ctx* exec_ctx,
+ grpc_handshake_manager* mgr) {
for (int i = 0; i < mgr->count; ++i) {
grpc_handshaker_destroy(exec_ctx, mgr->handshakers[i]);
}
gpr_free(mgr);
}
-void grpc_handshake_manager_shutdown(
- grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr) {
+void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx,
+ grpc_handshake_manager* mgr) {
// FIXME: maybe check which handshaker is currently in progress, and
// only shut down that one?
for (int i = 0; i < mgr->count; ++i) {
@@ -142,10 +143,12 @@ 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, gpr_timespec deadline,
- grpc_handshaker_done_cb cb, void* arg) {
+void grpc_handshake_manager_do_handshake(grpc_exec_ctx* exec_ctx,
+ grpc_handshake_manager* mgr,
+ grpc_endpoint* endpoint,
+ gpr_timespec deadline,
+ grpc_handshaker_done_cb cb,
+ void* arg) {
if (mgr->count == 0) {
// No handshakers registered, so we just immediately call the done
// callback with the passed-in endpoint.
@@ -158,5 +161,3 @@ void grpc_handshake_manager_do_handshake(
call_next_handshaker(exec_ctx, endpoint, mgr);
}
}
-
-#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */
diff --git a/src/core/lib/channel/handshaker.h b/src/core/lib/channel/handshaker.h
index c4e3bef5a5..583df4b241 100644
--- a/src/core/lib/channel/handshaker.h
+++ b/src/core/lib/channel/handshaker.h
@@ -48,22 +48,21 @@
typedef struct grpc_handshaker grpc_handshaker;
-typedef void (*grpc_handshaker_done_cb)(
- grpc_exec_ctx* exec_ctx, grpc_endpoint* endpoint, void* arg);
+typedef void (*grpc_handshaker_done_cb)(grpc_exec_ctx* exec_ctx,
+ grpc_endpoint* endpoint, void* arg);
struct grpc_handshaker_vtable {
void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker);
void (*shutdown)(grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker);
- void (*do_handshake)(
- grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker,
- grpc_endpoint* endpoint, gpr_timespec deadline,
- grpc_handshaker_done_cb cb, void* arg);
+ void (*do_handshake)(grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker,
+ grpc_endpoint* endpoint, gpr_timespec deadline,
+ grpc_handshaker_done_cb cb, void* arg);
};
struct grpc_handshaker {
- const struct grpc_handshaker_vtable *vtable;
+ const struct grpc_handshaker_vtable* vtable;
};
// Called by concrete implementations to initialize the base struct.
@@ -75,10 +74,11 @@ void grpc_handshaker_destroy(grpc_exec_ctx* exec_ctx,
grpc_handshaker* handshaker);
void grpc_handshaker_shutdown(grpc_exec_ctx* exec_ctx,
grpc_handshaker* handshaker);
-void grpc_handshaker_do_handshake(
- grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker,
- grpc_endpoint* endpoint, gpr_timespec deadline,
- grpc_handshaker_done_cb cb, void* arg);
+void grpc_handshaker_do_handshake(grpc_exec_ctx* exec_ctx,
+ grpc_handshaker* handshaker,
+ grpc_endpoint* endpoint,
+ gpr_timespec deadline,
+ grpc_handshaker_done_cb cb, void* arg);
//
// grpc_handshake_manager -- manages a set of handshakers
@@ -92,15 +92,16 @@ grpc_handshake_manager* grpc_handshake_manager_create();
void grpc_handshake_manager_add(grpc_handshaker* handshaker,
grpc_handshake_manager* mgr);
-void grpc_handshake_manager_destroy(
- grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr);
+void grpc_handshake_manager_destroy(grpc_exec_ctx* exec_ctx,
+ grpc_handshake_manager* mgr);
-void grpc_handshake_manager_shutdown(
- grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr);
+void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx,
+ grpc_handshake_manager* mgr);
-void grpc_handshake_manager_do_handshake(
- grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr,
- grpc_endpoint* endpoint, gpr_timespec deadline,
- grpc_handshaker_done_cb cb, void* arg);
+void grpc_handshake_manager_do_handshake(grpc_exec_ctx* exec_ctx,
+ grpc_handshake_manager* mgr,
+ grpc_endpoint* endpoint,
+ gpr_timespec deadline,
+ grpc_handshaker_done_cb cb, void* arg);
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */