Skip to content

http1: pass some encoder flags as params#11704

Merged
zuercher merged 1 commit into
envoyproxy:masterfrom
zuercher:szuecher_refactory_codec_encode_headers_base
Jun 24, 2020
Merged

http1: pass some encoder flags as params#11704
zuercher merged 1 commit into
envoyproxy:masterfrom
zuercher:szuecher_refactory_codec_encode_headers_base

Conversation

@zuercher
Copy link
Copy Markdown
Member

Commit Message:
Some flags in the StreamEncoderImpl are only necessary for the
duration of calls to encodeHeadersBase. Remove the fields and
pass response status as an optional value rather than setting
fields ahead of the encodeHeadersBase call.

Additional Description: This refactoring was promised during
review of #11458. This is a little more complicated than
passing a never-chunk-encode bool since the behavior also
covers content-length and may be partially disabled via
the runtime flag added in 11458. Assigned risk level medium
because it's the h1 encoder.

Risk Level: medium
Testing: existing tests pass
Doc Changes: n/a
Release Note: n/a

Signed-off-by: Stephan Zuercher zuercher@gmail.com

Commit Message:
Some flags in the StreamEncoderImpl are only necessary for the
duration of calls to encodeHeadersBase. Remove the fields and
pass response status as an optional value rather than setting
fields ahead of the encodeHeadersBase call.

Additional Description: This refactoring was promised during
review of envoyproxy#11458. This is a little more complicated than
passing a never-chunk-encode bool since the behavior also
covers content-length and may be partially disabled via
the runtime flag added in 11458. Assigned risk level medium
because its the h1 encoder.

Risk Level: medium
Testing: existing tests pass
Doc Changes: n/a
Release Note: n/a

Signed-off-by: Stephan Zuercher <zuercher@gmail.com>
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the way this turned out. Thanks for the follow-up!

@zuercher
Copy link
Copy Markdown
Member Author

On the fence about whether I should just merge this or look for another reviewer.

@mattklein123
Copy link
Copy Markdown
Member

I can take a quick look.

@mattklein123 mattklein123 self-assigned this Jun 24, 2020
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@zuercher zuercher merged commit 92c35e3 into envoyproxy:master Jun 24, 2020
@zuercher zuercher deleted the szuecher_refactory_codec_encode_headers_base branch June 24, 2020 21:16
songhu pushed a commit to songhu/envoy that referenced this pull request Jun 25, 2020
Some flags in the StreamEncoderImpl are only necessary for the
duration of calls to encodeHeadersBase. Remove the fields and
pass response status as an optional value rather than setting
fields ahead of the encodeHeadersBase call.

Risk Level: medium
Testing: existing tests pass
Doc Changes: n/a
Release Note: n/a

Signed-off-by: Stephan Zuercher <zuercher@gmail.com>
yashwant121 pushed a commit to yashwant121/envoy that referenced this pull request Jul 24, 2020
Some flags in the StreamEncoderImpl are only necessary for the
duration of calls to encodeHeadersBase. Remove the fields and
pass response status as an optional value rather than setting
fields ahead of the encodeHeadersBase call.

Risk Level: medium
Testing: existing tests pass
Doc Changes: n/a
Release Note: n/a

Signed-off-by: Stephan Zuercher <zuercher@gmail.com>
Signed-off-by: yashwant121 <yadavyashwant36@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants