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: Response.Body.Close() has nothing to do with re-use persistent connection #29886

Open
GenuineJyn opened this Issue Jan 23, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@GenuineJyn
Copy link

GenuineJyn commented Jan 23, 2019

err := es.body.Close()

err := es.body.Close() will return nil, not io.EOF

if the Body has been read, es.condfn(err) will return nil, fn not be called
if the Body has not yet been read, wiil enter return es.earlyCloseFn()

while in net/http/client.go has this comment:

// If the returned error is nil, the Response will contain a non-nil

the question is that the comment is not right: net/http: Response.Body.Close() has nothing to do with re-use persistent connection

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented Jan 23, 2019

I'm sorry, I don't understand your question. What are you asking? Can you show us some code?

It is likely that you will get a better and faster answer if you use a forum. See https://golang.org/wiki/Questions.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Jan 23, 2019

@FiloSottile FiloSottile changed the title Reponse.Body.Close() has nothing to do with re-use persistent connection net/http:Reponse.Body.Close() has nothing to do with re-use persistent connection Jan 23, 2019

@FiloSottile FiloSottile changed the title net/http:Reponse.Body.Close() has nothing to do with re-use persistent connection net/http: Reponse.Body.Close() has nothing to do with re-use persistent connection Jan 23, 2019

@GenuineJyn GenuineJyn changed the title net/http: Reponse.Body.Close() has nothing to do with re-use persistent connection net/http: Response.Body.Close() has nothing to do with re-use persistent connection Jan 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment