Descriptionhttp: fix transport bug with zero-length bodies
An optimization in Transport which re-uses TCP
connections early in the case where there is
no response body interacted poorly with
ErrBodyReadAfterClose. Upon recycling the TCP
connection early we would Close the Response.Body
(in case the user forgot to), but in the case
of a zero-lengthed body, the user's handler might
not have run yet.
This CL makes sure the Transport doesn't try
to Close requests when we're about to immediately
re-use the TCP connection.
This also includes additional tests I wrote
while debugging.
Patch Set 1 #Patch Set 2 : diff -r 3556fc4657a3 https://go.googlecode.com/hg/ #Patch Set 3 : diff -r 3556fc4657a3 https://go.googlecode.com/hg/ #
Total comments: 1
Patch Set 4 : diff -r 3556fc4657a3 https://go.googlecode.com/hg/ #Patch Set 5 : diff -r e02bcde2458d https://go.googlecode.com/hg/ #
MessagesTotal messages: 10
|