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
b8f97a4a
Commit
b8f97a4a
authored
8 years ago
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
Allow handshaking to be retried.
parent
c584d995
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/lib/channel/handshaker.c
+9
-8
9 additions, 8 deletions
src/core/lib/channel/handshaker.c
with
9 additions
and
8 deletions
src/core/lib/channel/handshaker.c
+
9
−
8
View file @
b8f97a4a
...
@@ -142,7 +142,7 @@ void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx,
...
@@ -142,7 +142,7 @@ void grpc_handshake_manager_shutdown(grpc_exec_ctx* exec_ctx,
grpc_handshake_manager
*
mgr
)
{
grpc_handshake_manager
*
mgr
)
{
gpr_mu_lock
(
&
mgr
->
mu
);
gpr_mu_lock
(
&
mgr
->
mu
);
// Shutdown the handshaker that's currently in progress, if any.
// Shutdown the handshaker that's currently in progress, if any.
if
(
mgr
->
index
>
0
&&
mgr
->
index
<=
mgr
->
count
)
{
if
(
mgr
->
index
>
0
)
{
grpc_handshaker_shutdown
(
exec_ctx
,
mgr
->
handshakers
[
mgr
->
index
-
1
]);
grpc_handshaker_shutdown
(
exec_ctx
,
mgr
->
handshakers
[
mgr
->
index
-
1
]);
}
}
gpr_mu_unlock
(
&
mgr
->
mu
);
gpr_mu_unlock
(
&
mgr
->
mu
);
...
@@ -157,20 +157,21 @@ static bool call_next_handshaker_locked(grpc_exec_ctx* exec_ctx,
...
@@ -157,20 +157,21 @@ static bool call_next_handshaker_locked(grpc_exec_ctx* exec_ctx,
GPR_ASSERT
(
mgr
->
index
<=
mgr
->
count
);
GPR_ASSERT
(
mgr
->
index
<=
mgr
->
count
);
// If we got an error or we've finished the last handshaker, invoke
// If we got an error or we've finished the last handshaker, invoke
// the on_handshake_done callback. Otherwise, call the next handshaker.
// the on_handshake_done callback. Otherwise, call the next handshaker.
bool
done
=
false
;
if
(
error
!=
GRPC_ERROR_NONE
||
mgr
->
index
==
mgr
->
count
)
{
if
(
error
!=
GRPC_ERROR_NONE
||
mgr
->
index
==
mgr
->
count
)
{
// Cancel deadline timer, since we're invoking the on_handshake_done
// Cancel deadline timer, since we're invoking the on_handshake_done
// callback now.
// callback now.
grpc_timer_cancel
(
exec_ctx
,
&
mgr
->
deadline_timer
);
grpc_timer_cancel
(
exec_ctx
,
&
mgr
->
deadline_timer
);
grpc_exec_ctx_sched
(
exec_ctx
,
&
mgr
->
on_handshake_done
,
error
,
NULL
);
grpc_exec_ctx_sched
(
exec_ctx
,
&
mgr
->
on_handshake_done
,
error
,
NULL
);
done
=
true
;
// Reset index to 0 so that we can start over if we re-attempt the
}
else
{
// connection.
grpc_handshaker_do_handshake
(
exec_ctx
,
mgr
->
handshakers
[
mgr
->
index
],
mgr
->
index
=
0
;
mgr
->
acceptor
,
&
mgr
->
call_next_handshaker
,
return
true
;
&
mgr
->
args
);
}
}
grpc_handshaker_do_handshake
(
exec_ctx
,
mgr
->
handshakers
[
mgr
->
index
],
mgr
->
acceptor
,
&
mgr
->
call_next_handshaker
,
&
mgr
->
args
);
++
mgr
->
index
;
++
mgr
->
index
;
return
don
e
;
return
fals
e
;
}
}
// A function used as the handshaker-done callback when chaining
// A function used as the handshaker-done callback when chaining
...
...
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