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

This comment has been minimized.

Copy link
Contributor Author

@nhooyr nhooyr commented Aug 12, 2018

Related #26941

@meirf

This comment has been minimized.

Copy link
Contributor

@meirf 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

This comment has been minimized.

Copy link
Contributor Author

@nhooyr 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 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.