Skip to content

wasm: stop iteration if local response sent#13873

Closed
mathetake wants to merge 1 commit intoenvoyproxy:masterfrom
mathetake:wasm-local-response-iteration
Closed

wasm: stop iteration if local response sent#13873
mathetake wants to merge 1 commit intoenvoyproxy:masterfrom
mathetake:wasm-local-response-iteration

Conversation

@mathetake
Copy link
Member

@mathetake mathetake commented Nov 3, 2020

Signed-off-by: mathetake takeshi@tetrate.io

resolves #13857

resolves envoyproxy#13857

Signed-off-by: mathetake <takeshi@tetrate.io>

// HTTP filter state.
bool http_request_started_ = false; // When decodeHeaders() is called the request is "started".
bool http_local_response_sent_ = false; // indicates if the local response is sent
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the only case when this can happen or should we call it something more general?

auto result = convertFilterHeadersStatus(onRequestHeaders(headerSize(&headers), end_stream));
if (result == Http::FilterHeadersStatus::Continue) {
if (http_local_response_sent_) {
return Http::FilterHeadersStatus::StopIteration;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you move the override into convertFilter{Headers,Data,Trailers}Status() calls instead of doing it inline?

@mathetake
Copy link
Member Author

moved to proxy-wasm/proxy-wasm-cpp-host#88 so I'm closing

@mathetake mathetake closed this Nov 4, 2020
@mathetake mathetake deleted the wasm-local-response-iteration branch June 29, 2021 04:17
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.

Crash using wasm-filter

3 participants