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

net/http: document that cancelling a request unblocks reads on the response body #26947

Closed
nhooyr opened this issue Aug 12, 2018 · 3 comments
Closed

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Aug 12, 2018

If you create a *http.Request, set a cancellable context on it, do the request and then begin reading the body, if you cancel the original context on the request, the read on the body will unblock. This is not documented anywhere afaik but is extremely useful behaviour.

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 12, 2018

Related #26941

@meirf
Copy link
Contributor

meirf commented Aug 12, 2018

@nhooyr do you think this a dup of #26101? any interest in uploading a change for this/that issue?

@nhooyr
Copy link
Contributor Author

nhooyr commented Aug 13, 2018

@meirf Yup, this is a dup of #26101. Thanks.

I will try and get in a CL for it.

@nhooyr nhooyr closed this as completed Aug 13, 2018
@golang golang locked and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants