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
30a1beb0
Commit
30a1beb0
authored
8 years ago
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
Fix edge cases in HTTP CONNECT handshaker.
parent
f9b56b93
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/ext/client_channel/http_connect_handshaker.c
+4
-4
4 additions, 4 deletions
src/core/ext/client_channel/http_connect_handshaker.c
with
4 additions
and
4 deletions
src/core/ext/client_channel/http_connect_handshaker.c
+
4
−
4
View file @
30a1beb0
...
...
@@ -56,6 +56,8 @@ typedef struct http_connect_handshaker {
gpr_mu
mu
;
// State saved while performing the handshake.
// args will be NULL when either there is no handshake in progress or
// when the handshaker is shutting down.
grpc_handshaker_args
*
args
;
grpc_closure
*
on_handshake_done
;
...
...
@@ -84,7 +86,7 @@ static void http_connect_handshaker_unref(http_connect_handshaker* handshaker) {
static
void
on_write_done
(
grpc_exec_ctx
*
exec_ctx
,
void
*
arg
,
grpc_error
*
error
)
{
http_connect_handshaker
*
handshaker
=
arg
;
if
(
error
!=
GRPC_ERROR_NONE
)
{
if
(
error
!=
GRPC_ERROR_NONE
||
handshaker
->
args
==
NULL
)
{
// If the write failed, invoke the callback immediately with the error.
gpr_mu_lock
(
&
handshaker
->
mu
);
grpc_exec_ctx_sched
(
exec_ctx
,
handshaker
->
on_handshake_done
,
...
...
@@ -96,7 +98,6 @@ static void on_write_done(grpc_exec_ctx* exec_ctx, void* arg,
// Otherwise, read the response.
// The read callback inherits our ref to the handshaker.
gpr_mu_lock
(
&
handshaker
->
mu
);
GPR_ASSERT
(
handshaker
->
args
!=
NULL
);
grpc_endpoint_read
(
exec_ctx
,
handshaker
->
args
->
endpoint
,
handshaker
->
args
->
read_buffer
,
&
handshaker
->
response_read_closure
);
...
...
@@ -109,8 +110,7 @@ static void on_read_done(grpc_exec_ctx* exec_ctx, void* arg,
grpc_error
*
error
)
{
http_connect_handshaker
*
handshaker
=
arg
;
gpr_mu_lock
(
&
handshaker
->
mu
);
GPR_ASSERT
(
handshaker
->
args
!=
NULL
);
if
(
error
!=
GRPC_ERROR_NONE
)
{
if
(
error
!=
GRPC_ERROR_NONE
||
handshaker
->
args
==
NULL
)
{
GRPC_ERROR_REF
(
error
);
// Take ref to pass to the handshake-done callback.
goto
done
;
}
...
...
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