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
a540848c
Commit
a540848c
authored
8 years ago
by
David Garcia Quintas
Browse files
Options
Downloads
Patches
Plain Diff
Fixed http_client race
parent
d960c8b1
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/http_client_filter.c
+6
-3
6 additions, 3 deletions
src/core/lib/channel/http_client_filter.c
with
6 additions
and
3 deletions
src/core/lib/channel/http_client_filter.c
+
6
−
3
View file @
a540848c
...
...
@@ -245,12 +245,15 @@ static void hc_mutate_op(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
message, and the payload is below the size threshold, and all the data
for this request is immediately available. */
grpc_mdelem
*
method
=
GRPC_MDELEM_METHOD_POST
;
calld
->
send_message_blocked
=
false
;
if
((
op
->
send_initial_metadata_flags
&
GRPC_INITIAL_METADATA_CACHEABLE_REQUEST
)
&&
op
->
send_message
!=
NULL
&&
op
->
send_message
->
length
<
channeld
->
max_payload_size_for_get
)
{
method
=
GRPC_MDELEM_METHOD_GET
;
/* The following write to calld->send_message_blocked isn't racy with
reads in hc_start_transport_op (which deals with SEND_MESSAGE ops) because
being here means ops->send_message is not NULL, which is primarily
guarding the read there. */
calld
->
send_message_blocked
=
true
;
}
else
if
(
op
->
send_initial_metadata_flags
&
GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST
)
{
...
...
@@ -331,8 +334,7 @@ static void hc_start_transport_op(grpc_exec_ctx *exec_ctx,
call_data
*
calld
=
elem
->
call_data
;
if
(
op
->
send_message
!=
NULL
&&
calld
->
send_message_blocked
)
{
/* Don't forward the op. send_message contains slices that aren't ready
yet. The call will be forwarded by the op_complete of slice read call.
*/
yet. The call will be forwarded by the op_complete of slice read call. */
}
else
{
grpc_call_next_op
(
exec_ctx
,
elem
,
op
);
}
...
...
@@ -347,6 +349,7 @@ static grpc_error *init_call_elem(grpc_exec_ctx *exec_ctx,
calld
->
on_done_recv_trailing_metadata
=
NULL
;
calld
->
on_complete
=
NULL
;
calld
->
payload_bytes
=
NULL
;
calld
->
send_message_blocked
=
false
;
grpc_slice_buffer_init
(
&
calld
->
slices
);
grpc_closure_init
(
&
calld
->
hc_on_recv_initial_metadata
,
hc_on_recv_initial_metadata
,
elem
);
...
...
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