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

Closed
GenuineJyn opened this issue Jan 23, 2019 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@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
Copy link
Contributor

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 WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. Question labels Jan 23, 2019
@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
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Feb 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants