Skip to content

Conversation

austinderek
Copy link

Currently, if an http response body is closed before fully read (fully means till EOF),
the underlying HTTP connection won't be reused. But in the current implementation,
body is first read into bufio buffer by bufio reader, then from buffer by body Reader.
So even if the body is closed before fully read, as long as the entire body has been
read into buffer, after discard buffer, the connection can be reused.

This will be useful when go client only read body if status is 200 while server sends
HTTP body in a non 200 status response.


🔄 This is a mirror of upstream PR golang#75303

@austinderek austinderek force-pushed the master branch 29 times, most recently from 861c90c to 37c78b5 Compare September 8, 2025 06:02
@austinderek austinderek force-pushed the master branch 30 times, most recently from c1e6e49 to 5bf50a0 Compare October 7, 2025 06:02
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