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
d7af7367
Commit
d7af7367
authored
9 years ago
by
Craig Tiller
Browse files
Options
Downloads
Plain Diff
Merge pull request #3010 from dgquintas/head_vs_tails
Assert http2 header ordering
parents
99d37614
bb88b900
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
+12
-0
12 additions, 0 deletions
src/core/transport/chttp2/stream_encoder.c
with
12 additions
and
0 deletions
src/core/transport/chttp2/stream_encoder.c
+
12
−
0
View file @
d7af7367
...
@@ -66,6 +66,8 @@ typedef struct {
...
@@ -66,6 +66,8 @@ typedef struct {
size_t
header_idx
;
size_t
header_idx
;
/* was the last frame emitted a header? (if yes, we'll need a CONTINUATION */
/* was the last frame emitted a header? (if yes, we'll need a CONTINUATION */
gpr_uint8
last_was_header
;
gpr_uint8
last_was_header
;
/* have we seen a regular (non-colon-prefixed) header yet? */
gpr_uint8
seen_regular_header
;
/* output stream id */
/* output stream id */
gpr_uint32
stream_id
;
gpr_uint32
stream_id
;
gpr_slice_buffer
*
output
;
gpr_slice_buffer
*
output
;
...
@@ -361,6 +363,15 @@ static grpc_mdelem *hpack_enc(grpc_chttp2_hpack_compressor *c,
...
@@ -361,6 +363,15 @@ static grpc_mdelem *hpack_enc(grpc_chttp2_hpack_compressor *c,
gpr_uint32
indices_key
;
gpr_uint32
indices_key
;
int
should_add_elem
;
int
should_add_elem
;
GPR_ASSERT
(
GPR_SLICE_LENGTH
(
elem
->
key
->
slice
)
>
0
);
if
(
GPR_SLICE_START_PTR
(
elem
->
key
->
slice
)[
0
]
!=
':'
)
{
/* regular header */
st
->
seen_regular_header
=
1
;
}
else
if
(
st
->
seen_regular_header
!=
0
)
{
/* reserved header */
gpr_log
(
GPR_ERROR
,
"Reserved header (colon-prefixed) happening after regular ones."
);
abort
();
}
inc_filter
(
HASH_FRAGMENT_1
(
elem_hash
),
&
c
->
filter_elems_sum
,
c
->
filter_elems
);
inc_filter
(
HASH_FRAGMENT_1
(
elem_hash
),
&
c
->
filter_elems_sum
,
c
->
filter_elems
);
/* is this elem currently in the decoders table? */
/* is this elem currently in the decoders table? */
...
@@ -566,6 +577,7 @@ void grpc_chttp2_encode(grpc_stream_op *ops, size_t ops_count, int eof,
...
@@ -566,6 +577,7 @@ void grpc_chttp2_encode(grpc_stream_op *ops, size_t ops_count, int eof,
st
.
cur_frame_type
=
NONE
;
st
.
cur_frame_type
=
NONE
;
st
.
last_was_header
=
0
;
st
.
last_was_header
=
0
;
st
.
seen_regular_header
=
0
;
st
.
stream_id
=
stream_id
;
st
.
stream_id
=
stream_id
;
st
.
output
=
output
;
st
.
output
=
output
;
...
...
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