mirror of
https://github.com/docker/cli.git
synced 2026-08-28 10:05:17 -05:00
vendor: golang.org/x/net v0.58.0
full diff: https://github.com/golang/net/compare/v0.57.0...v0.58.0 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
+1
-1
@@ -104,7 +104,7 @@ require (
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
|
||||
golang.org/x/mod v0.39.0 // indirect
|
||||
golang.org/x/net v0.57.0 // indirect
|
||||
golang.org/x/net v0.58.0 // indirect
|
||||
golang.org/x/time v0.15.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
|
||||
|
||||
+2
-2
@@ -245,8 +245,8 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
|
||||
golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU=
|
||||
golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To=
|
||||
golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
|
||||
-1
@@ -39,7 +39,6 @@ func NewEncoder(w io.Writer) *Encoder {
|
||||
tableSizeUpdate: false,
|
||||
w: w,
|
||||
}
|
||||
e.dynTab.table.init()
|
||||
e.dynTab.setMaxSize(initialHeaderTableSize)
|
||||
return e
|
||||
}
|
||||
|
||||
-1
@@ -105,7 +105,6 @@ func NewDecoder(maxDynamicTableSize uint32, emitFunc func(f HeaderField)) *Decod
|
||||
emitEnabled: true,
|
||||
firstField: true,
|
||||
}
|
||||
d.dynTab.table.init()
|
||||
d.dynTab.allowedMaxSize = maxDynamicTableSize
|
||||
d.dynTab.setMaxSize(maxDynamicTableSize)
|
||||
return d
|
||||
|
||||
+37
-14
@@ -31,10 +31,18 @@ type headerFieldTable struct {
|
||||
|
||||
// byName maps a HeaderField name to the unique id of the newest entry with
|
||||
// the same name. See above for a definition of "unique id".
|
||||
//
|
||||
// byName and byNameValue are used only by search, which is only called
|
||||
// for tables used by encoders. For tables used only by decoders, the
|
||||
// maps are never built, as a memory optimization for servers with many
|
||||
// mostly-idle connections, each pinning a dynamic table. The maps are
|
||||
// built lazily by the first search call and are nil until then. The two
|
||||
// maps are always both nil or both non-nil.
|
||||
byName map[string]uint64
|
||||
|
||||
// byNameValue maps a HeaderField name/value pair to the unique id of the newest
|
||||
// entry with the same name and value. See above for a definition of "unique id".
|
||||
// See byName for when this map is non-nil.
|
||||
byNameValue map[pairNameValue]uint64
|
||||
}
|
||||
|
||||
@@ -42,9 +50,17 @@ type pairNameValue struct {
|
||||
name, value string
|
||||
}
|
||||
|
||||
func (t *headerFieldTable) init() {
|
||||
t.byName = make(map[string]uint64)
|
||||
t.byNameValue = make(map[pairNameValue]uint64)
|
||||
// buildMaps initializes byName and byNameValue from ents.
|
||||
func (t *headerFieldTable) buildMaps() {
|
||||
t.byName = make(map[string]uint64, len(t.ents))
|
||||
t.byNameValue = make(map[pairNameValue]uint64, len(t.ents))
|
||||
for k, f := range t.ents {
|
||||
// Map to the newest matching entry: later (newer) entries
|
||||
// overwrite earlier ones, matching addEntry's behavior.
|
||||
id := t.evictCount + uint64(k) + 1
|
||||
t.byName[f.Name] = id
|
||||
t.byNameValue[pairNameValue{f.Name, f.Value}] = id
|
||||
}
|
||||
}
|
||||
|
||||
// len reports the number of entries in the table.
|
||||
@@ -54,9 +70,11 @@ func (t *headerFieldTable) len() int {
|
||||
|
||||
// addEntry adds a new entry.
|
||||
func (t *headerFieldTable) addEntry(f HeaderField) {
|
||||
id := uint64(t.len()) + t.evictCount + 1
|
||||
t.byName[f.Name] = id
|
||||
t.byNameValue[pairNameValue{f.Name, f.Value}] = id
|
||||
if t.byName != nil {
|
||||
id := uint64(t.len()) + t.evictCount + 1
|
||||
t.byName[f.Name] = id
|
||||
t.byNameValue[pairNameValue{f.Name, f.Value}] = id
|
||||
}
|
||||
t.ents = append(t.ents, f)
|
||||
}
|
||||
|
||||
@@ -65,14 +83,16 @@ func (t *headerFieldTable) evictOldest(n int) {
|
||||
if n > t.len() {
|
||||
panic(fmt.Sprintf("evictOldest(%v) on table with %v entries", n, t.len()))
|
||||
}
|
||||
for k := 0; k < n; k++ {
|
||||
f := t.ents[k]
|
||||
id := t.evictCount + uint64(k) + 1
|
||||
if t.byName[f.Name] == id {
|
||||
delete(t.byName, f.Name)
|
||||
}
|
||||
if p := (pairNameValue{f.Name, f.Value}); t.byNameValue[p] == id {
|
||||
delete(t.byNameValue, p)
|
||||
if t.byName != nil {
|
||||
for k := 0; k < n; k++ {
|
||||
f := t.ents[k]
|
||||
id := t.evictCount + uint64(k) + 1
|
||||
if t.byName[f.Name] == id {
|
||||
delete(t.byName, f.Name)
|
||||
}
|
||||
if p := (pairNameValue{f.Name, f.Value}); t.byNameValue[p] == id {
|
||||
delete(t.byNameValue, p)
|
||||
}
|
||||
}
|
||||
}
|
||||
copy(t.ents, t.ents[n:])
|
||||
@@ -100,6 +120,9 @@ func (t *headerFieldTable) evictOldest(n int) {
|
||||
//
|
||||
// See Section 2.3.3.
|
||||
func (t *headerFieldTable) search(f HeaderField) (i uint64, nameValueMatch bool) {
|
||||
if t.byName == nil {
|
||||
t.buildMaps()
|
||||
}
|
||||
if !f.Sensitive {
|
||||
if id := t.byNameValue[pairNameValue{f.Name, f.Value}]; id != 0 {
|
||||
return t.idToIndex(id), true
|
||||
|
||||
+32
-19
@@ -237,32 +237,40 @@ type ClientConn struct {
|
||||
}
|
||||
|
||||
func (cc *ClientConn) roundTrip(req *http.Request) (*http.Response, error) {
|
||||
err := func() error {
|
||||
haveReservation, err := func() (bool, error) {
|
||||
cc.mu.Lock()
|
||||
defer cc.mu.Unlock()
|
||||
if cc.doNotReuse {
|
||||
return errClientConnUnusable
|
||||
}
|
||||
cc.roundTrips++
|
||||
if cc.reserved > 0 {
|
||||
// We've already reserved a concurrency slot for this request.
|
||||
cc.reserved--
|
||||
} else if cc.cc.Reserve() != nil {
|
||||
// We don't seem to have an available concurrency slot,
|
||||
// so bump the pending count (requests waiting for a slot).
|
||||
cc.pending++
|
||||
return false, errClientConnUnusable
|
||||
}
|
||||
|
||||
// ClientConn.Shutdown will not shut down the conn while
|
||||
// cc.starting > 0 or cc.cc.InFlight() > 0.
|
||||
//
|
||||
// The starting state covers the gap between us deciding to
|
||||
// start sending the request, and actually sending it.
|
||||
cc.starting++
|
||||
return nil
|
||||
|
||||
cc.roundTrips++
|
||||
if cc.reserved == 0 {
|
||||
// We do not have a concurrency slot reserved for this request.
|
||||
return false, nil
|
||||
}
|
||||
cc.reserved--
|
||||
return true, nil
|
||||
}()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// If we have no reservation, try to acquire one.
|
||||
// (This must be done without cc.mu held, since Reserve may call back to the state hook.)
|
||||
if !haveReservation && cc.cc.Reserve() != nil {
|
||||
// We could not acquire a concurrency slot, so bump the pending count
|
||||
// (requests waiting for a slot).
|
||||
cc.mu.Lock()
|
||||
cc.pending++
|
||||
cc.mu.Unlock()
|
||||
}
|
||||
resp, err := cc.cc.RoundTrip(req)
|
||||
cc.mu.Lock()
|
||||
cc.starting--
|
||||
@@ -293,16 +301,21 @@ func (cc *ClientConn) ping(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (cc *ClientConn) reserveNewRequest() bool {
|
||||
cc.mu.Lock()
|
||||
defer cc.mu.Unlock()
|
||||
if cc.doNotReuse {
|
||||
return false
|
||||
}
|
||||
if err := cc.cc.Reserve(); err != nil {
|
||||
return false
|
||||
}
|
||||
cc.reserved++
|
||||
return true
|
||||
reserved := true
|
||||
cc.mu.Lock()
|
||||
if cc.doNotReuse {
|
||||
reserved = false
|
||||
} else {
|
||||
cc.reserved++
|
||||
}
|
||||
cc.mu.Unlock()
|
||||
if !reserved {
|
||||
cc.cc.Release()
|
||||
}
|
||||
return reserved
|
||||
}
|
||||
|
||||
func (cc *ClientConn) setDoNotReuse() {
|
||||
|
||||
Vendored
+1
-1
@@ -399,7 +399,7 @@ golang.org/x/mod/internal/lazyregexp
|
||||
golang.org/x/mod/modfile
|
||||
golang.org/x/mod/module
|
||||
golang.org/x/mod/semver
|
||||
# golang.org/x/net v0.57.0
|
||||
# golang.org/x/net v0.58.0
|
||||
## explicit; go 1.25.0
|
||||
golang.org/x/net/http/httpguts
|
||||
golang.org/x/net/http2
|
||||
|
||||
Reference in New Issue
Block a user