Skip to content
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

wasm: stop iteration if local response sent #13873

Closed

Conversation

mathetake
Copy link
Member

@mathetake mathetake commented Nov 3, 2020

Signed-off-by: mathetake [email protected]

resolves #13857

@@ -425,6 +425,7 @@ class Context : public proxy_wasm::ContextBase,

// 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?

@@ -1579,9 +1580,12 @@ Http::FilterHeadersStatus Context::decodeHeaders(Http::RequestHeaderMap& headers
request_headers_ = &headers;
end_of_stream_ = end_stream;
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