Skip to content
Snippets Groups Projects
Commit 1d3b2cc8 authored by Mark D. Roth's avatar Mark D. Roth
Browse files

clang-format

parent c05539f8
No related branches found
No related tags found
No related merge requests found
...@@ -52,12 +52,13 @@ void grpc_handshaker_shutdown(grpc_exec_ctx* exec_ctx, ...@@ -52,12 +52,13 @@ void grpc_handshaker_shutdown(grpc_exec_ctx* exec_ctx,
handshaker->vtable->shutdown(exec_ctx, handshaker); handshaker->vtable->shutdown(exec_ctx, handshaker);
} }
void grpc_handshaker_do_handshake( void grpc_handshaker_do_handshake(grpc_exec_ctx* exec_ctx,
grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker, grpc_handshaker* handshaker,
grpc_endpoint* endpoint, gpr_timespec deadline, grpc_endpoint* endpoint,
grpc_handshaker_done_cb cb, void* arg) { gpr_timespec deadline,
handshaker->vtable->do_handshake(exec_ctx, handshaker, endpoint, grpc_handshaker_done_cb cb, void* arg) {
deadline, cb, arg); handshaker->vtable->do_handshake(exec_ctx, handshaker, endpoint, deadline, cb,
arg);
} }
// //
...@@ -96,16 +97,16 @@ void grpc_handshake_manager_add(grpc_handshaker* handshaker, ...@@ -96,16 +97,16 @@ void grpc_handshake_manager_add(grpc_handshaker* handshaker,
mgr->handshakers[mgr->count++] = handshaker; mgr->handshakers[mgr->count++] = handshaker;
} }
void grpc_handshake_manager_destroy( void grpc_handshake_manager_destroy(grpc_exec_ctx* exec_ctx,
grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr) { grpc_handshake_manager* mgr) {
for (int i = 0; i < mgr->count; ++i) { for (int i = 0; i < mgr->count; ++i) {
grpc_handshaker_destroy(exec_ctx, mgr->handshakers[i]); grpc_handshaker_destroy(exec_ctx, mgr->handshakers[i]);
} }
gpr_free(mgr); gpr_free(mgr);
} }
void grpc_handshake_manager_shutdown( void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx,
grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr) { grpc_handshake_manager* mgr) {
// FIXME: maybe check which handshaker is currently in progress, and // FIXME: maybe check which handshaker is currently in progress, and
// only shut down that one? // only shut down that one?
for (int i = 0; i < mgr->count; ++i) { for (int i = 0; i < mgr->count; ++i) {
...@@ -142,10 +143,12 @@ static void call_next_handshaker(grpc_exec_ctx* exec_ctx, ...@@ -142,10 +143,12 @@ static void call_next_handshaker(grpc_exec_ctx* exec_ctx,
} }
} }
void grpc_handshake_manager_do_handshake( void grpc_handshake_manager_do_handshake(grpc_exec_ctx* exec_ctx,
grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr, grpc_handshake_manager* mgr,
grpc_endpoint* endpoint, gpr_timespec deadline, grpc_endpoint* endpoint,
grpc_handshaker_done_cb cb, void* arg) { gpr_timespec deadline,
grpc_handshaker_done_cb cb,
void* arg) {
if (mgr->count == 0) { if (mgr->count == 0) {
// No handshakers registered, so we just immediately call the done // No handshakers registered, so we just immediately call the done
// callback with the passed-in endpoint. // callback with the passed-in endpoint.
...@@ -158,5 +161,3 @@ void grpc_handshake_manager_do_handshake( ...@@ -158,5 +161,3 @@ void grpc_handshake_manager_do_handshake(
call_next_handshaker(exec_ctx, endpoint, mgr); call_next_handshaker(exec_ctx, endpoint, mgr);
} }
} }
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */
...@@ -48,22 +48,21 @@ ...@@ -48,22 +48,21 @@
typedef struct grpc_handshaker grpc_handshaker; typedef struct grpc_handshaker grpc_handshaker;
typedef void (*grpc_handshaker_done_cb)( typedef void (*grpc_handshaker_done_cb)(grpc_exec_ctx* exec_ctx,
grpc_exec_ctx* exec_ctx, grpc_endpoint* endpoint, void* arg); grpc_endpoint* endpoint, void* arg);
struct grpc_handshaker_vtable { struct grpc_handshaker_vtable {
void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker); void (*destroy)(grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker);
void (*shutdown)(grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker); void (*shutdown)(grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker);
void (*do_handshake)( void (*do_handshake)(grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker,
grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker, grpc_endpoint* endpoint, gpr_timespec deadline,
grpc_endpoint* endpoint, gpr_timespec deadline, grpc_handshaker_done_cb cb, void* arg);
grpc_handshaker_done_cb cb, void* arg);
}; };
struct grpc_handshaker { struct grpc_handshaker {
const struct grpc_handshaker_vtable *vtable; const struct grpc_handshaker_vtable* vtable;
}; };
// Called by concrete implementations to initialize the base struct. // Called by concrete implementations to initialize the base struct.
...@@ -75,10 +74,11 @@ void grpc_handshaker_destroy(grpc_exec_ctx* exec_ctx, ...@@ -75,10 +74,11 @@ void grpc_handshaker_destroy(grpc_exec_ctx* exec_ctx,
grpc_handshaker* handshaker); grpc_handshaker* handshaker);
void grpc_handshaker_shutdown(grpc_exec_ctx* exec_ctx, void grpc_handshaker_shutdown(grpc_exec_ctx* exec_ctx,
grpc_handshaker* handshaker); grpc_handshaker* handshaker);
void grpc_handshaker_do_handshake( void grpc_handshaker_do_handshake(grpc_exec_ctx* exec_ctx,
grpc_exec_ctx* exec_ctx, grpc_handshaker* handshaker, grpc_handshaker* handshaker,
grpc_endpoint* endpoint, gpr_timespec deadline, grpc_endpoint* endpoint,
grpc_handshaker_done_cb cb, void* arg); gpr_timespec deadline,
grpc_handshaker_done_cb cb, void* arg);
// //
// grpc_handshake_manager -- manages a set of handshakers // grpc_handshake_manager -- manages a set of handshakers
...@@ -92,15 +92,16 @@ grpc_handshake_manager* grpc_handshake_manager_create(); ...@@ -92,15 +92,16 @@ grpc_handshake_manager* grpc_handshake_manager_create();
void grpc_handshake_manager_add(grpc_handshaker* handshaker, void grpc_handshake_manager_add(grpc_handshaker* handshaker,
grpc_handshake_manager* mgr); grpc_handshake_manager* mgr);
void grpc_handshake_manager_destroy( void grpc_handshake_manager_destroy(grpc_exec_ctx* exec_ctx,
grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr); grpc_handshake_manager* mgr);
void grpc_handshake_manager_shutdown( void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx,
grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr); grpc_handshake_manager* mgr);
void grpc_handshake_manager_do_handshake( void grpc_handshake_manager_do_handshake(grpc_exec_ctx* exec_ctx,
grpc_exec_ctx* exec_ctx, grpc_handshake_manager* mgr, grpc_handshake_manager* mgr,
grpc_endpoint* endpoint, gpr_timespec deadline, grpc_endpoint* endpoint,
grpc_handshaker_done_cb cb, void* arg); gpr_timespec deadline,
grpc_handshaker_done_cb cb, void* arg);
#endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */ #endif /* GRPC_CORE_LIB_CHANNEL_HANDSHAKER_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment