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
b753ab4c
Commit
b753ab4c
authored
9 years ago
by
Yang Gao
Browse files
Options
Downloads
Plain Diff
Merge pull request #1426 from ctiller/bad-frame
Fix errant empty data frame after trailers
parents
f2791ab0
3b1e37d1
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/transport/chttp2/stream_encoder.c
+7
-3
7 additions, 3 deletions
src/core/transport/chttp2/stream_encoder.c
with
7 additions
and
3 deletions
src/core/transport/chttp2/stream_encoder.c
+
7
−
3
View file @
b753ab4c
...
@@ -122,6 +122,12 @@ static void begin_frame(framer_state *st, frame_type type) {
...
@@ -122,6 +122,12 @@ static void begin_frame(framer_state *st, frame_type type) {
st
->
output_length_at_start_of_frame
=
st
->
output
->
length
;
st
->
output_length_at_start_of_frame
=
st
->
output
->
length
;
}
}
static
void
begin_new_frame
(
framer_state
*
st
,
frame_type
type
)
{
finish_frame
(
st
,
1
,
0
);
st
->
last_was_header
=
0
;
begin_frame
(
st
,
type
);
}
/* make sure that the current frame is of the type desired, and has sufficient
/* make sure that the current frame is of the type desired, and has sufficient
space to add at least about_to_add bytes -- finishes the current frame if
space to add at least about_to_add bytes -- finishes the current frame if
needed */
needed */
...
@@ -571,6 +577,7 @@ void grpc_chttp2_encode(grpc_stream_op *ops, size_t ops_count, int eof,
...
@@ -571,6 +577,7 @@ void grpc_chttp2_encode(grpc_stream_op *ops, size_t ops_count, int eof,
a metadata element that needs to be unreffed back into the metadata
a metadata element that needs to be unreffed back into the metadata
slot. THIS MAY NOT BE THE SAME ELEMENT (if a decoder table slot got
slot. THIS MAY NOT BE THE SAME ELEMENT (if a decoder table slot got
updated). After this loop, we'll do a batch unref of elements. */
updated). After this loop, we'll do a batch unref of elements. */
begin_new_frame
(
&
st
,
HEADER
);
need_unref
|=
op
->
data
.
metadata
.
garbage
.
head
!=
NULL
;
need_unref
|=
op
->
data
.
metadata
.
garbage
.
head
!=
NULL
;
grpc_metadata_batch_assert_ok
(
&
op
->
data
.
metadata
);
grpc_metadata_batch_assert_ok
(
&
op
->
data
.
metadata
);
for
(
l
=
op
->
data
.
metadata
.
list
.
head
;
l
;
l
=
l
->
next
)
{
for
(
l
=
op
->
data
.
metadata
.
list
.
head
;
l
;
l
=
l
->
next
)
{
...
@@ -580,9 +587,6 @@ void grpc_chttp2_encode(grpc_stream_op *ops, size_t ops_count, int eof,
...
@@ -580,9 +587,6 @@ void grpc_chttp2_encode(grpc_stream_op *ops, size_t ops_count, int eof,
if
(
gpr_time_cmp
(
op
->
data
.
metadata
.
deadline
,
gpr_inf_future
)
!=
0
)
{
if
(
gpr_time_cmp
(
op
->
data
.
metadata
.
deadline
,
gpr_inf_future
)
!=
0
)
{
deadline_enc
(
compressor
,
op
->
data
.
metadata
.
deadline
,
&
st
);
deadline_enc
(
compressor
,
op
->
data
.
metadata
.
deadline
,
&
st
);
}
}
ensure_frame_type
(
&
st
,
HEADER
,
0
);
finish_frame
(
&
st
,
1
,
0
);
st
.
last_was_header
=
0
;
/* force a new header frame */
curop
++
;
curop
++
;
break
;
break
;
case
GRPC_OP_SLICE
:
case
GRPC_OP_SLICE
:
...
...
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