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
3578c5e5
Commit
3578c5e5
authored
8 years ago
by
Makarand Dharmapurikar
Browse files
Options
Downloads
Patches
Plain Diff
bug fix for fireball app
modified condition for trailing metadata. added more information to log message.
parent
91d51953
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
+12
-8
12 additions, 8 deletions
src/core/ext/transport/cronet/transport/cronet_transport.c
with
12 additions
and
8 deletions
src/core/ext/transport/cronet/transport/cronet_transport.c
+
12
−
8
View file @
3578c5e5
...
...
@@ -412,7 +412,7 @@ static void on_read_completed(cronet_bidirectional_stream *stream, char *data,
s
->
state
.
rs
.
received_bytes
+=
count
;
s
->
state
.
rs
.
remaining_bytes
-=
count
;
if
(
s
->
state
.
rs
.
remaining_bytes
>
0
)
{
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_read
"
);
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_read
(%p)"
,
s
->
cbs
);
s
->
state
.
state_op_done
[
OP_READ_REQ_MADE
]
=
true
;
cronet_bidirectional_stream_read
(
s
->
cbs
,
s
->
state
.
rs
.
read_buffer
+
s
->
state
.
rs
.
received_bytes
,
...
...
@@ -602,6 +602,9 @@ static bool op_can_be_run(grpc_transport_stream_op *curr_op,
/* we haven't received trailers yet. */
else
if
(
!
stream_state
->
state_callback_received
[
OP_RECV_TRAILING_METADATA
])
result
=
false
;
/* we haven't received on_succeeded yet. */
else
if
(
!
stream_state
->
state_callback_received
[
OP_SUCCEEDED
])
result
=
false
;
}
else
if
(
op_id
==
OP_SEND_TRAILING_METADATA
)
{
/* already executed */
if
(
stream_state
->
state_op_done
[
OP_SEND_TRAILING_METADATA
])
result
=
false
;
...
...
@@ -699,16 +702,17 @@ static enum OP_RESULT execute_stream_op(struct op_and_state *oas) {
/* Start new cronet stream. It is destroyed in on_succeeded, on_canceled,
* on_failed */
GPR_ASSERT
(
s
->
cbs
==
NULL
);
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_create"
);
s
->
cbs
=
cronet_bidirectional_stream_create
(
s
->
curr_ct
.
engine
,
s
->
curr_gs
,
&
cronet_callbacks
);
CRONET_LOG
(
GPR_DEBUG
,
"%p = cronet_bidirectional_stream_create()"
,
s
->
cbs
);
char
*
url
;
s
->
header_array
.
headers
=
NULL
;
convert_metadata_to_cronet_headers
(
stream_op
->
send_initial_metadata
->
list
.
head
,
s
->
curr_ct
.
host
,
&
url
,
&
s
->
header_array
.
headers
,
&
s
->
header_array
.
count
);
s
->
header_array
.
capacity
=
s
->
header_array
.
count
;
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_start %s"
,
url
);
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_start(%p, %s)"
,
s
->
cbs
,
url
);
cronet_bidirectional_stream_start
(
s
->
cbs
,
url
,
0
,
"POST"
,
&
s
->
header_array
,
false
);
stream_state
->
state_op_done
[
OP_SEND_INITIAL_METADATA
]
=
true
;
...
...
@@ -746,8 +750,8 @@ static enum OP_RESULT execute_stream_op(struct op_and_state *oas) {
int
write_buffer_size
;
create_grpc_frame
(
&
write_slice_buffer
,
&
stream_state
->
ws
.
write_buffer
,
&
write_buffer_size
);
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_write (%p)"
,
stream_state
->
ws
.
write_buffer
);
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_write (
%p,
%p)"
,
s
->
cbs
,
stream_state
->
ws
.
write_buffer
);
stream_state
->
state_callback_received
[
OP_SEND_MESSAGE
]
=
false
;
cronet_bidirectional_stream_write
(
s
->
cbs
,
stream_state
->
ws
.
write_buffer
,
write_buffer_size
,
false
);
...
...
@@ -785,7 +789,7 @@ static enum OP_RESULT execute_stream_op(struct op_and_state *oas) {
GPR_ASSERT
(
stream_state
->
rs
.
read_buffer
);
stream_state
->
rs
.
remaining_bytes
=
stream_state
->
rs
.
length_field
;
stream_state
->
rs
.
received_bytes
=
0
;
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_read
"
);
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_read
(%p)"
,
s
->
cbs
);
stream_state
->
state_op_done
[
OP_READ_REQ_MADE
]
=
true
;
/* Indicates that at least one read request has been made */
cronet_bidirectional_stream_read
(
s
->
cbs
,
stream_state
->
rs
.
read_buffer
,
...
...
@@ -810,7 +814,7 @@ static enum OP_RESULT execute_stream_op(struct op_and_state *oas) {
stream_state
->
rs
.
read_buffer
=
stream_state
->
rs
.
grpc_header_bytes
;
stream_state
->
rs
.
remaining_bytes
=
GRPC_HEADER_SIZE_IN_BYTES
;
stream_state
->
rs
.
received_bytes
=
0
;
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_read
"
);
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_read
(%p)"
,
s
->
cbs
);
stream_state
->
state_op_done
[
OP_READ_REQ_MADE
]
=
true
;
/* Indicates that at least one read request has been made */
cronet_bidirectional_stream_read
(
s
->
cbs
,
stream_state
->
rs
.
read_buffer
,
...
...
@@ -857,7 +861,7 @@ static enum OP_RESULT execute_stream_op(struct op_and_state *oas) {
op_can_be_run
(
stream_op
,
stream_state
,
&
oas
->
state
,
OP_SEND_TRAILING_METADATA
))
{
CRONET_LOG
(
GPR_DEBUG
,
"running: %p OP_SEND_TRAILING_METADATA"
,
oas
);
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_write (
0)"
);
CRONET_LOG
(
GPR_DEBUG
,
"cronet_bidirectional_stream_write (
%p, 0)"
,
s
->
cbs
);
stream_state
->
state_callback_received
[
OP_SEND_MESSAGE
]
=
false
;
cronet_bidirectional_stream_write
(
s
->
cbs
,
""
,
0
,
true
);
stream_state
->
state_op_done
[
OP_SEND_TRAILING_METADATA
]
=
true
;
...
...
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