Skip to content

Add support for closing of connections in the ABI/SDK. #29

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

Merged
merged 2 commits into from
Jun 23, 2020
Merged

Conversation

jplevyak
Copy link
Contributor

Signed-off-by: John Plevyak [email protected]

proxy_wasm_api.h Outdated
inline WasmResult continueResponse() { return proxy_continue_stream(WasmStreamType::Response); }

inline WasmResult closeRequest() { return proxy_close_stream(WasmStreamType::Request); }
inline WasmResult closeResponse() { return proxy_continue_stream(WasmStreamType::Response); }
Copy link
Collaborator

Choose a reason for hiding this comment

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

close_stream?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanx! fixed.

Signed-off-by: John Plevyak <[email protected]>
@jplevyak jplevyak requested a review from kyessenov June 16, 2020 19:35
inline WasmResult continueResponse() { return proxy_continue_stream(WasmStreamType::Response); }

inline WasmResult closeRequest() { return proxy_close_stream(WasmStreamType::Request); }
inline WasmResult closeResponse() { return proxy_close_stream(WasmStreamType::Response); }
Copy link
Member

@PiotrSikora PiotrSikora Jun 16, 2020

Choose a reason for hiding this comment

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

I think close should be exposed only for network filters.

We generally don't expose underlying connection in HTTP (at least not yet), and there is no concept of closing request separately from closing response (unless we start doing retries within Proxy-Wasm, but that's not there yet). Also, we already have send_local_response, which effectively terminates HTTP request/response flow, and seems like much more elegant way to terminate HTTP request/response than hard close (e.g. there would be response code and details in the logs).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about the case where you are tunneling another protocol through say HTTP CONNECT or POST and there is a error in the inner protocol? Do we want to jam an HTTP response in the middle of the request? Is that legal for CONNECT?

Copy link
Member

Choose a reason for hiding this comment

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

Tunneling via HTTP/2 CONNECT is going to be handed off to normal network filters, not HTTP filters, so it won't be handled as HTTP request/response in Proxy-Wasm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, I like the idea of being able to just shut something down, even if we are in the middle of say tunneling the response.

@jplevyak jplevyak requested a review from PiotrSikora June 16, 2020 21:23
@jplevyak
Copy link
Contributor Author

Ping.

@jplevyak jplevyak merged commit 35163bb into master Jun 23, 2020
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