16 << 10,
}
http2dataChunkPools = [...]sync.Pool{
- {New: func() any { return make([]byte, 1<<10) }},
- {New: func() any { return make([]byte, 2<<10) }},
- {New: func() any { return make([]byte, 4<<10) }},
- {New: func() any { return make([]byte, 8<<10) }},
- {New: func() any { return make([]byte, 16<<10) }},
+ {New: func() interface{} { return make([]byte, 1<<10) }},
+ {New: func() interface{} { return make([]byte, 2<<10) }},
+ {New: func() interface{} { return make([]byte, 4<<10) }},
+ {New: func() interface{} { return make([]byte, 8<<10) }},
+ {New: func() interface{} { return make([]byte, 16<<10) }},
}
)
// frame header bytes.
// Used only by ReadFrameHeader.
var http2fhBytes = sync.Pool{
- New: func() any {
+ New: func() interface{} {
buf := make([]byte, http2frameHeaderLen)
return &buf
},
debugFramer *http2Framer // only use for logging written writes
debugFramerBuf *bytes.Buffer
- debugReadLoggerf func(string, ...any)
- debugWriteLoggerf func(string, ...any)
+ debugReadLoggerf func(string, ...interface{})
+ debugWriteLoggerf func(string, ...interface{})
frameCache *http2frameCache // nil if frames aren't reused (default)
}
}
var http2littleBuf = sync.Pool{
- New: func() any {
+ New: func() interface{} {
buf := make([]byte, 64)
return &buf
},
const http2bufWriterPoolBufferSize = 4 << 10
var http2bufWriterPool = sync.Pool{
- New: func() any {
+ New: func() interface{} {
return bufio.NewWriterSize(nil, http2bufWriterPoolBufferSize)
},
}
ConnectionState() tls.ConnectionState
}
-var http2sorterPool = sync.Pool{New: func() any { return new(http2sorter) }}
+var http2sorterPool = sync.Pool{New: func() interface{} { return new(http2sorter) }}
type http2sorter struct {
v []string // owned by sorter
)
var http2responseWriterStatePool = sync.Pool{
- New: func() any {
+ New: func() interface{} {
rws := &http2responseWriterState{}
rws.bw = bufio.NewWriterSize(http2chunkWriter{rws}, http2handlerChunkWriteSize)
return rws
http2testHookOnConn func()
http2testHookGetServerConn func(*http2serverConn)
http2testHookOnPanicMu *sync.Mutex // nil except in tests
- http2testHookOnPanic func(sc *http2serverConn, panicVal any) (rePanic bool)
+ http2testHookOnPanic func(sc *http2serverConn, panicVal interface{}) (rePanic bool)
)
// Server is an HTTP/2 server.
streams: make(map[uint32]*http2stream),
readFrameCh: make(chan http2readFrameResult),
wantWriteFrameCh: make(chan http2FrameWriteRequest, 8),
- serveMsgCh: make(chan any, 8),
+ serveMsgCh: make(chan interface{}, 8),
wroteFrameCh: make(chan http2frameWriteResult, 1), // buffered; one send in writeFrameAsync
bodyReadCh: make(chan http2bodyReadMsg), // buffering doesn't matter either way
doneServing: make(chan struct{}),
wantWriteFrameCh chan http2FrameWriteRequest // from handlers -> serve
wroteFrameCh chan http2frameWriteResult // from writeFrameAsync -> serve, tickles more frame writes
bodyReadCh chan http2bodyReadMsg // from handlers -> serve
- serveMsgCh chan any // misc messages & code to send to / run on the serve loop
+ serveMsgCh chan interface{} // misc messages & code to send to / run on the serve loop
flow http2flow // conn-wide (not stream-specific) outbound flow control
inflow http2flow // conn-wide inbound flow control
tlsState *tls.ConnectionState // shared by all handlers, like net/http
}
}
-func (sc *http2serverConn) vlogf(format string, args ...any) {
+func (sc *http2serverConn) vlogf(format string, args ...interface{}) {
if http2VerboseLogs {
sc.logf(format, args...)
}
}
-func (sc *http2serverConn) logf(format string, args ...any) {
+func (sc *http2serverConn) logf(format string, args ...interface{}) {
if lg := sc.hs.ErrorLog; lg != nil {
lg.Printf(format, args...)
} else {
return false
}
-func (sc *http2serverConn) condlogf(err error, format string, args ...any) {
+func (sc *http2serverConn) condlogf(err error, format string, args ...interface{}) {
if err == nil {
return
}
func (sc *http2serverConn) onShutdownTimer() { sc.sendServeMsg(http2shutdownTimerMsg) }
-func (sc *http2serverConn) sendServeMsg(msg any) {
+func (sc *http2serverConn) sendServeMsg(msg interface{}) {
sc.serveG.checkNotOn() // NOT
select {
case sc.serveMsgCh <- msg:
}
var http2errChanPool = sync.Pool{
- New: func() any { return make(chan error, 1) },
+ New: func() interface{} { return make(chan error, 1) },
}
var http2writeDataPool = sync.Pool{
- New: func() any { return new(http2writeData) },
+ New: func() interface{} { return new(http2writeData) },
}
// writeDataFromHandler writes DATA response frames from a handler on
// disabled. See comments on h1ServerShutdownChan above for why
// the code is written this way.
func http2h1ServerKeepAlivesDisabled(hs *Server) bool {
- var x any = hs
+ var x interface{} = hs
type I interface {
doKeepAlives() bool
}
http2errRequestHeaderListSize = errors.New("http2: request header list larger than peer's advertised limit")
)
-func (cc *http2ClientConn) logf(format string, args ...any) {
+func (cc *http2ClientConn) logf(format string, args ...interface{}) {
cc.t.logf(format, args...)
}
-func (cc *http2ClientConn) vlogf(format string, args ...any) {
+func (cc *http2ClientConn) vlogf(format string, args ...interface{}) {
cc.t.vlogf(format, args...)
}
-func (t *http2Transport) vlogf(format string, args ...any) {
+func (t *http2Transport) vlogf(format string, args ...interface{}) {
if http2VerboseLogs {
t.logf(format, args...)
}
}
-func (t *http2Transport) logf(format string, args ...any) {
+func (t *http2Transport) logf(format string, args ...interface{}) {
log.Printf(format, args...)
}