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

close response body #31

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

close response body #31

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 27, 2017

No description provided.

// Create json for request
json, err := json.Marshal(volume.Request{})
// Create json for request - local variable json masks the global symbol json referring to the JSON module
jsn, err := json.Marshal(volume.Request{})
Copy link
Member

Choose a reason for hiding this comment

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

Was this intentional? Probably should leave it as json

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think json is a package name

Copy link
Member

Choose a reason for hiding this comment

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

ah, yes that makes sense
I wonder how this didn't cause problems before in our testing?

@JohnStarich
Copy link
Member

I'm a bit confused what the patch is for. Did we fail to close the response body in the server? If so, perhaps we should change non-tests too?

@ghost
Copy link
Author

ghost commented Apr 27, 2017

I was going based off of the comment If the returned error is nil, the Response will contain a non-nil Body which the user is expected to close. If the Body is not closed, the Client's underlying RoundTripper (typically Transport) may not be able to re-use a persistent TCP connection to the server for a subsequent "keep-alive" request. from http/client.go

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.

2 participants