aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/export_test.go
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2026-03-03 08:12:25 -0800
committerGopher Robot <gobot@golang.org>2026-03-12 08:13:20 -0700
commit080aa8e9647e5211650f34f3a93fb493afbe396d (patch)
treeab00dcd761d3622f08ff5aa7e2a52ff8c1fd0591 /src/net/http/export_test.go
parent81908597a8787b09b1da90e7c6d3461b4302820f (diff)
downloadgo-080aa8e9647e5211650f34f3a93fb493afbe396d.tar.xz
net/http: use net/http/internal/http2 rather than h2_bundle.go
Rework net/http/internal/http2 to use internally-defined types rather than net/http types (to avoid an import cycle). Remove h2_bundle.go, and replace it with calls into net/http/internal/http2 instead. For #67810 Change-Id: I56a1b28dbd0e302ab15a30f819dd46256a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/751304 Reviewed-by: Nicholas Husin <nsh@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Nicholas Husin <husin@google.com>
Diffstat (limited to 'src/net/http/export_test.go')
-rw-r--r--src/net/http/export_test.go34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/net/http/export_test.go b/src/net/http/export_test.go
index 472d9c37ae..b499769c4f 100644
--- a/src/net/http/export_test.go
+++ b/src/net/http/export_test.go
@@ -29,7 +29,6 @@ var (
ExportErrServerClosedIdle = errServerClosedIdle
ExportServeFile = serveFile
ExportScanETag = scanETag
- ExportHttp2ConfigureServer = http2ConfigureServer
Export_shouldCopyHeaderOnRedirect = shouldCopyHeaderOnRedirect
Export_writeStatusLine = writeStatusLine
Export_is408Message = is408Message
@@ -135,29 +134,15 @@ func (t *Transport) IdleConnStrsForTesting() []string {
defer t.idleMu.Unlock()
for _, conns := range t.idleConn {
for _, pc := range conns {
+ if pc.conn == nil {
+ continue
+ }
ret = append(ret, pc.conn.LocalAddr().String()+"/"+pc.conn.RemoteAddr().String())
}
}
- slices.Sort(ret)
- return ret
-}
-
-func (t *Transport) IdleConnStrsForTesting_h2() []string {
- var ret []string
- noDialPool := t.h2transport.(*http2Transport).ConnPool.(http2noDialClientConnPool)
- pool := noDialPool.http2clientConnPool
-
- pool.mu.Lock()
- defer pool.mu.Unlock()
-
- for k, ccs := range pool.conns {
- for _, cc := range ccs {
- if cc.idleState().canTakeNewRequest {
- ret = append(ret, k)
- }
- }
+ if f, ok := t.h2transport.(interface{ IdleConnStrsForTesting() []string }); ok {
+ ret = append(ret, f.IdleConnStrsForTesting()...)
}
-
slices.Sort(ret)
return ret
}
@@ -256,15 +241,6 @@ func hookSetter(dst *func()) func(func()) {
}
}
-func ExportHttp2ConfigureTransport(t *Transport) error {
- t2, err := http2configureTransports(t)
- if err != nil {
- return err
- }
- t.h2transport = t2
- return nil
-}
-
func (s *Server) ExportAllConnsIdle() bool {
s.mu.Lock()
defer s.mu.Unlock()