merge: Merge upstream v1.14.6

This commit is contained in:
Shtorm
2026-11-30 19:46:00 +03:00
292 changed files with 6311 additions and 5159 deletions
+4 -3
View File
@@ -4,12 +4,13 @@ import "context"
type contextKeyIsExternalConnection struct{}
func ContextWithIsExternalConnection(ctx context.Context) context.Context {
return context.WithValue(ctx, contextKeyIsExternalConnection{}, true)
func ContextWithIsExternalConnection(ctx context.Context, isExternal bool) context.Context {
return context.WithValue(ctx, contextKeyIsExternalConnection{}, isExternal)
}
func IsExternalConnectionFromContext(ctx context.Context) bool {
return ctx.Value(contextKeyIsExternalConnection{}) != nil
isExternal, _ := ctx.Value(contextKeyIsExternalConnection{}).(bool)
return isExternal
}
type contextKeyIsProviderConnection struct{}
+11
View File
@@ -24,6 +24,17 @@ func NewGroup() *Group {
return &Group{}
}
func (g *Group) Add(closer io.Closer, isExternal bool) (remove func()) {
g.access.Lock()
defer g.access.Unlock()
element := g.connections.PushBack(&groupConnItem{conn: closer, isExternal: isExternal})
return func() {
g.access.Lock()
defer g.access.Unlock()
g.connections.Remove(element)
}
}
func (g *Group) NewConn(conn net.Conn, isExternal bool, isProvider bool) net.Conn {
g.access.Lock()
defer g.access.Unlock()