Thanks Nigel! I think if my experiment is done correctly, the difference
without adding the io.Copy means that when context ends, the underlying TCP
connection is forced to close. This may or may not be by design. If it is,
I think I'd like to make a feature request some times, we don't necessarily
want to close the underlying TCP connection.
On Thursday, March 31, 2016 at 5:20:58 PM UTC-7, Nigel Tao wrote:

On Wed, Mar 30, 2016 at 9:32 AM, Guanhua Jiang <steve...@gmail.com
<javascript:>> wrote:
So, according to that, it seems like the goroutine at
x/net/context/ctxhttp/ctxhttp.go:60 will not properly cleanup the response
body. An additional statement of something like, io.Copy(ioutil.Discard,
resp.Body), should be added before it closes the body. Is this the right
idea? Or am I missing something, like resp.Body.Close() would actually read
everyone on that TCP connection?
cbro (CC'ed) might know the answer.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 9 | next ›
Discussion Overview
groupgolang-nuts @
postedMar 29, '16 at 10:32p
activeApr 7, '16 at 1:45p



site design / logo © 2021 Grokbase