]> Cypherpunks repositories - gostls13.git/commit
net/http: add Transport.IdleConnTimeout
authorBrad Fitzpatrick <bradfitz@golang.org>
Sun, 1 May 2016 02:11:42 +0000 (21:11 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sun, 1 May 2016 05:47:09 +0000 (05:47 +0000)
commitabc1472d78c70888473634497b49b1c2e1bb6569
treeb1c9de2b49dc7c966748b48ad578c0ba99d428ba
parent0ab78df9ea602d6bc9cf45dbd610c3d6f534cb58
net/http: add Transport.IdleConnTimeout

Don't keep idle HTTP client connections open forever. Add a new knob,
Transport.IdleConnTimeout, and make the default be 90 seconds. I
figure 90 seconds is more than a minute, and less than infinite, and I
figure enough code has things waking up once a minute polling APIs.

This also removes the Transport's idleCount field which was unused and
redundant with the size of the idleLRU map (which was actually used).

Change-Id: Ibb698a9a9a26f28e00a20fe7ed23f4afb20c2322
Reviewed-on: https://go-review.googlesource.com/22670
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/export_test.go
src/net/http/transport.go
src/net/http/transport_test.go