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
04b06b7e
Commit
04b06b7e
authored
8 years ago
by
Muxi Yan
Browse files
Options
Downloads
Patches
Plain Diff
Add comments
parent
e6e7fd0c
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/transport/cronet/transport/cronet_transport.c
+11
-0
11 additions, 0 deletions
src/core/ext/transport/cronet/transport/cronet_transport.c
with
11 additions
and
0 deletions
src/core/ext/transport/cronet/transport/cronet_transport.c
+
11
−
0
View file @
04b06b7e
...
@@ -152,12 +152,16 @@ struct write_state {
...
@@ -152,12 +152,16 @@ struct write_state {
struct
op_state
{
struct
op_state
{
bool
state_op_done
[
OP_NUM_OPS
];
bool
state_op_done
[
OP_NUM_OPS
];
bool
state_callback_received
[
OP_NUM_OPS
];
bool
state_callback_received
[
OP_NUM_OPS
];
/* A non-zero gRPC status code has been seen */
bool
fail_state
;
bool
fail_state
;
/* Transport is discarding all buffered messages */
bool
flush_read
;
bool
flush_read
;
bool
flush_cronet_when_ready
;
bool
flush_cronet_when_ready
;
bool
pending_write_for_trailer
;
bool
pending_write_for_trailer
;
bool
pending_send_message
;
bool
pending_send_message
;
/* User requested RECV_TRAILING_METADATA */
bool
pending_recv_trailing_metadata
;
bool
pending_recv_trailing_metadata
;
/* Cronet has not issued a callback of a bidirectional read */
bool
pending_read_from_cronet
;
bool
pending_read_from_cronet
;
grpc_error
*
cancel_error
;
grpc_error
*
cancel_error
;
/* data structure for storing data coming from server */
/* data structure for storing data coming from server */
...
@@ -260,6 +264,13 @@ static void null_and_maybe_free_read_buffer(stream_obj *s) {
...
@@ -260,6 +264,13 @@ static void null_and_maybe_free_read_buffer(stream_obj *s) {
}
}
static
void
maybe_flush_read
(
stream_obj
*
s
)
{
static
void
maybe_flush_read
(
stream_obj
*
s
)
{
/* To enter flush read state (discarding all the buffered messages in
* transport layer), two conditions must be satisfied: 1) non-zero grpc status
* has been received, and 2) an op requesting the status code
* (RECV_TRAILING_METADATA) is issued by the user. (See
* doc/status_ordering.md) */
/* Whenever the evaluation of any of the two condition is changed, we check
* whether we should enter the flush read state. */
if
(
s
->
state
.
pending_recv_trailing_metadata
&&
s
->
state
.
fail_state
)
{
if
(
s
->
state
.
pending_recv_trailing_metadata
&&
s
->
state
.
fail_state
)
{
if
(
!
s
->
state
.
flush_read
)
{
if
(
!
s
->
state
.
flush_read
)
{
CRONET_LOG
(
GPR_DEBUG
,
"%p: Flush read"
,
s
);
CRONET_LOG
(
GPR_DEBUG
,
"%p: Flush read"
,
s
);
...
...
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