Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
1d3b2cc8
Commit
1d3b2cc8
authored
8 years ago
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
clang-format
parent
c05539f8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/lib/channel/handshaker.c
+17
-16
17 additions, 16 deletions
src/core/lib/channel/handshaker.c
src/core/lib/channel/handshaker.h
+20
-19
20 additions, 19 deletions
src/core/lib/channel/handshaker.h
with
37 additions
and
35 deletions
src/core/lib/channel/handshaker.c
+
17
−
16
View file @
1d3b2cc8
...
@@ -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 */
This diff is collapsed.
Click to expand it.
src/core/lib/channel/handshaker.h
+
20
−
19
View file @
1d3b2cc8
...
@@ -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 */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment