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

Cancel context only after response body is read #4979

Closed
wants to merge 3 commits into from
Closed

Conversation

jefferai
Copy link
Member

Fixes #4973

@jefferai jefferai added this to the 0.10.4 milestone Jul 23, 2018
Copy link

@ebilling ebilling left a comment

Choose a reason for hiding this comment

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

Inside the RawRequest function, moving the cancelFunc is helpful, but it would be much better to refactor the code into another function and call it from within the loop, then you could set up your context and defer the cancelFunc call while making the code much easier to read. This is a long method. I tested it with my use case that had empty Body but set content-lengths on cancels, and this does pass my test.

@briankassouf
Copy link
Member

Closing in favor of #4987

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