diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:23:02 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:23:02 +0200 |
commit | 8fcc691d6fa80c9ddf38bf0d34b803bab0e421d5 (patch) | |
tree | ba71646a10b518372d110532d86fcf0b98edc14f /src/pkg/net/http/export_test.go | |
parent | 3bb719bbf3cdb97b3901f3baaa2da9d02a5c3cdb (diff) | |
parent | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (diff) | |
download | golang-8fcc691d6fa80c9ddf38bf0d34b803bab0e421d5.tar.gz |
Merge tag 'upstream/1.3' into debian-sid
Upstream version 1.3
Diffstat (limited to 'src/pkg/net/http/export_test.go')
-rw-r--r-- | src/pkg/net/http/export_test.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/pkg/net/http/export_test.go b/src/pkg/net/http/export_test.go index 22b7f2796..960563b24 100644 --- a/src/pkg/net/http/export_test.go +++ b/src/pkg/net/http/export_test.go @@ -21,7 +21,7 @@ var ExportAppendTime = appendTime func (t *Transport) NumPendingRequestsForTesting() int { t.reqMu.Lock() defer t.reqMu.Unlock() - return len(t.reqConn) + return len(t.reqCanceler) } func (t *Transport) IdleConnKeysForTesting() (keys []string) { @@ -32,7 +32,7 @@ func (t *Transport) IdleConnKeysForTesting() (keys []string) { return } for key := range t.idleConn { - keys = append(keys, key) + keys = append(keys, key.String()) } return } @@ -43,11 +43,12 @@ func (t *Transport) IdleConnCountForTesting(cacheKey string) int { if t.idleConn == nil { return 0 } - conns, ok := t.idleConn[cacheKey] - if !ok { - return 0 + for k, conns := range t.idleConn { + if k.String() == cacheKey { + return len(conns) + } } - return len(conns) + return 0 } func (t *Transport) IdleConnChMapSizeForTesting() int { @@ -63,4 +64,9 @@ func NewTestTimeoutHandler(handler Handler, ch <-chan time.Time) Handler { return &timeoutHandler{handler, f, ""} } +func ResetCachedEnvironment() { + httpProxyEnv.reset() + noProxyEnv.reset() +} + var DefaultUserAgent = defaultUserAgent |