aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/omithttp2.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/omithttp2.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/omithttp2.go')
-rw-r--r--src/net/http/omithttp2.go67
1 files changed, 5 insertions, 62 deletions
diff --git a/src/net/http/omithttp2.go b/src/net/http/omithttp2.go
index ca08ddfad8..f12c6afee7 100644
--- a/src/net/http/omithttp2.go
+++ b/src/net/http/omithttp2.go
@@ -6,74 +6,17 @@
package http
-import (
- "errors"
- "sync"
- "time"
-)
-
func init() {
omitBundledHTTP2 = true
}
const noHTTP2 = "no bundled HTTP/2" // should never see this
-var http2errRequestCanceled = errors.New("net/http: request canceled")
-
-var http2goAwayTimeout = 1 * time.Second
-
-const http2NextProtoTLS = "h2"
-
-type http2Transport struct {
- MaxHeaderListSize uint32
- ConnPool any
-}
-
-func (*http2Transport) RoundTrip(*Request) (*Response, error) { panic(noHTTP2) }
-func (*http2Transport) CloseIdleConnections() {}
-
-type http2noDialH2RoundTripper struct{}
-
-func (http2noDialH2RoundTripper) RoundTrip(*Request) (*Response, error) { panic(noHTTP2) }
-
-type http2noDialClientConnPool struct {
- http2clientConnPool http2clientConnPool
-}
-
-type http2clientConnPool struct {
- mu *sync.Mutex
- conns map[string][]*http2clientConn
-}
-
-type http2clientConn struct{}
-
-type http2clientConnIdleState struct {
- canTakeNewRequest bool
-}
-
-func (cc *http2clientConn) idleState() http2clientConnIdleState { return http2clientConnIdleState{} }
-
-func http2configureTransports(*Transport) (*http2Transport, error) { panic(noHTTP2) }
-
-func http2isNoCachedConnError(err error) bool {
- _, ok := err.(interface{ IsHTTP2NoCachedConnError() })
- return ok
-}
-
-type http2Server struct {
- NewWriteScheduler func() http2WriteScheduler
-}
-
-type http2WriteScheduler any
-
-func http2NewPriorityWriteScheduler(any) http2WriteScheduler { panic(noHTTP2) }
-
-func http2ConfigureServer(s *Server, conf *http2Server) error { panic(noHTTP2) }
-
-var http2ErrNoCachedConn = http2noCachedConnError{}
+func (s *Server) configureHTTP2() {}
+func (t *Transport) configureHTTP2(protocols Protocols) {}
-type http2noCachedConnError struct{}
+type http2Server struct{}
-func (http2noCachedConnError) IsHTTP2NoCachedConnError() {}
+type http2RoundTripper struct{}
-func (http2noCachedConnError) Error() string { return "http2: no cached connection was available" }
+func (http2RoundTripper) RoundTrip(*Request) (*Response, error) { panic(noHTTP2) }