-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Flow control for Http::Filters #1417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a604e38
4804be6
1040f67
647845a
3a8cf94
a445e52
4f80dec
9267859
8ac29e1
95de98b
ae42c02
f705fed
f99ca46
d0a823a
7e5b7c1
471fe64
668932f
37d940e
19aaf38
1292a58
558fb59
9ac14b1
6b5f615
220fcf3
9685ee9
a970125
1409730
eaed1ae
9bf5df7
0bead86
612eacb
3bfbc51
a94b527
be29d74
0d534df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -226,7 +226,7 @@ Http::FilterHeadersStatus JsonTranscoderFilter::decodeHeaders(Http::HeaderMap& h | |
| readToBuffer(*transcoder_->RequestOutput(), data); | ||
|
|
||
| if (data.length() > 0) { | ||
| decoder_callbacks_->addDecodedData(data); | ||
| decoder_callbacks_->addDecodedData(data, true); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is TODO(lizan) somewhere in here about using watermarks to bound buffer size. I think that is done with this change so we can remove todo? cc @lizan
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I wasn't sure if the transcoder was infinite buffering under the hood, so I figured @lizan could remove the TODO after checking |
||
| } | ||
| } | ||
| return Http::FilterHeadersStatus::Continue; | ||
|
|
@@ -273,7 +273,7 @@ Http::FilterTrailersStatus JsonTranscoderFilter::decodeTrailers(Http::HeaderMap& | |
| readToBuffer(*transcoder_->RequestOutput(), data); | ||
|
|
||
| if (data.length()) { | ||
| decoder_callbacks_->addDecodedData(data); | ||
| decoder_callbacks_->addDecodedData(data, true); | ||
| } | ||
| return Http::FilterTrailersStatus::Continue; | ||
| } | ||
|
|
@@ -311,6 +311,7 @@ Http::FilterDataStatus JsonTranscoderFilter::encodeData(Buffer::Instance& data, | |
| readToBuffer(*transcoder_->ResponseOutput(), data); | ||
|
|
||
| if (!method_->server_streaming()) { | ||
| // Buffer until the response is complete. | ||
| return Http::FilterDataStatus::StopIterationAndBuffer; | ||
| } | ||
| // TODO(lizan): Check ResponseStatus | ||
|
|
@@ -329,7 +330,7 @@ Http::FilterTrailersStatus JsonTranscoderFilter::encodeTrailers(Http::HeaderMap& | |
| readToBuffer(*transcoder_->ResponseOutput(), data); | ||
|
|
||
| if (data.length()) { | ||
| encoder_callbacks_->addEncodedData(data); | ||
| encoder_callbacks_->addEncodedData(data, true); | ||
| } | ||
|
|
||
| if (method_->server_streaming()) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I'm also happy to remove all the boilerplate comments once you've taken a look, Matt, I just wanted a way to call all unchanged returns of StopIterationAndBuffer to your attention. Let me know when/if you want them gone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I wasn't referring to this (comment is fine with me if you want it), but the extra boilerplate functions every filter needs to implement, which I think we have agreed will now be opt-in. 👍