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

http3: respect request context while reading from the response body #4205

Open
marten-seemann opened this issue Dec 14, 2023 · 1 comment
Open

Comments

@marten-seemann
Copy link
Member

marten-seemann commented Dec 14, 2023

The Go documentation for the request context says:

For an outgoing client request, the context controls the entire lifetime of a request and its response: obtaining a connection, sending the request, and reading the response headers and body.

The http.Response.Body therefore needs to return the context error as well. I confirmed that this is what HTTP/2 does.

Currently, we don't even pass the context to the body, and it's not clear to me how to correctly respect the context without spawning a new Go routine, since the Stream.Read call is blocking call.

Originally posted by @marten-seemann in #4203 (comment)

@marten-seemann
Copy link
Member Author

@jhump provided a test case in #4203 (comment) that we can use without any modification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant