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
7c2a58c1
Commit
7c2a58c1
authored
8 years ago
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
Fix build problems.
parent
dfbdefed
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
+15
-8
15 additions, 8 deletions
src/core/lib/channel/handshaker.c
src/core/lib/channel/handshaker.h
+1
-1
1 addition, 1 deletion
src/core/lib/channel/handshaker.h
with
16 additions
and
9 deletions
src/core/lib/channel/handshaker.c
+
15
−
8
View file @
7c2a58c1
...
...
@@ -31,6 +31,11 @@
*
*/
#include
<string.h>
#include
<grpc/impl/codegen/alloc.h>
#include
<grpc/impl/codegen/log.h>
#include
"src/core/lib/channel/handshaker.h"
//
...
...
@@ -38,7 +43,7 @@
//
void
grpc_handshaker_init
(
const
struct
grpc_handshaker_vtable
*
vtable
,
grpc_handshaker
*
*
handshaker
)
{
grpc_handshaker
*
handshaker
)
{
handshaker
->
vtable
=
vtable
;
}
...
...
@@ -79,9 +84,9 @@ struct grpc_handshaker_state {
struct
grpc_handshake_manager
{
// An array of handshakers added via grpc_handshake_manager_add().
size_t
count
;
grpc_handshaker
*
handshakers
;
grpc_handshaker
*
*
handshakers
;
// State used while chaining handshakers.
grpc_handshaker_state
*
state
;
struct
grpc_handshaker_state
*
state
;
};
grpc_handshake_manager
*
grpc_handshake_manager_create
()
{
...
...
@@ -99,7 +104,7 @@ void grpc_handshake_manager_add(grpc_handshaker* handshaker,
void
grpc_handshake_manager_destroy
(
grpc_exec_ctx
*
exec_ctx
,
grpc_handshake_manager
*
mgr
)
{
for
(
in
t
i
=
0
;
i
<
mgr
->
count
;
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
mgr
->
count
;
++
i
)
{
grpc_handshaker_destroy
(
exec_ctx
,
mgr
->
handshakers
[
i
]);
}
gpr_free
(
mgr
);
...
...
@@ -109,7 +114,7 @@ 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
(
in
t
i
=
0
;
i
<
mgr
->
count
;
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
mgr
->
count
;
++
i
)
{
grpc_handshaker_shutdown
(
exec_ctx
,
mgr
->
handshakers
[
i
]);
}
if
(
mgr
->
state
!=
NULL
)
{
...
...
@@ -155,9 +160,11 @@ void grpc_handshake_manager_do_handshake(grpc_exec_ctx* exec_ctx,
cb
(
exec_ctx
,
endpoint
,
arg
);
}
else
{
GPR_ASSERT
(
mgr
->
state
==
NULL
);
mgr
->
state
=
gpr_malloc
(
sizeof
(
grpc_handshaker_state
));
memset
(
mgr
->
state
,
0
,
sizeof
(
grpc_handshaker_state
));
*
mgr
->
state
=
{
0
,
deadline
,
cb
,
arg
};
mgr
->
state
=
gpr_malloc
(
sizeof
(
struct
grpc_handshaker_state
));
memset
(
mgr
->
state
,
0
,
sizeof
(
*
mgr
->
state
));
mgr
->
state
->
deadline
=
deadline
;
mgr
->
state
->
final_cb
=
cb
;
mgr
->
state
->
final_arg
=
arg
;
call_next_handshaker
(
exec_ctx
,
endpoint
,
mgr
);
}
}
This diff is collapsed.
Click to expand it.
src/core/lib/channel/handshaker.h
+
1
−
1
View file @
7c2a58c1
...
...
@@ -67,7 +67,7 @@ struct grpc_handshaker {
// Called by concrete implementations to initialize the base struct.
void
grpc_handshaker_init
(
const
struct
grpc_handshaker_vtable
*
vtable
,
grpc_handshaker
*
*
handshaker
);
grpc_handshaker
*
handshaker
);
// Convenient wrappers for invoking methods via the vtable.
void
grpc_handshaker_destroy
(
grpc_exec_ctx
*
exec_ctx
,
...
...
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