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

Comments

Projects
None yet
3 participants
@nhooyr
Copy link
Contributor

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

commented Aug 12, 2018

Related #26941

@meirf

This comment has been minimized.

Copy link
Contributor

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.