Skip to content

net/http: Response.Body.Close() has nothing to do with re-use persistent connection #29886

Closed
@GenuineJyn

Description

@GenuineJyn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions