Merge tag 'v1.14.3'

This commit is contained in:
Shtorm
2026-10-19 01:05:55 +03:00
321 changed files with 6750 additions and 5105 deletions
+2 -17
View File
@@ -2,7 +2,6 @@ package failover
import (
"context"
"errors"
"net"
"sync"
@@ -60,9 +59,9 @@ func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLo
return inbound, nil
}
func (h *Inbound) Start(stage adapter.StartStage) error {
func (h *Inbound) Start(stage adapter.StartStage, scope *adapter.Scope) error {
for _, inbound := range h.inbounds {
err := inbound.Start(stage)
err := scope.Start("inbound/"+inbound.Type()+"["+inbound.Tag()+"]", inbound, stage)
if err != nil {
return err
}
@@ -70,20 +69,6 @@ func (h *Inbound) Start(stage adapter.StartStage) error {
return nil
}
func (h *Inbound) Close() error {
errs := make([]error, 0)
for _, inbound := range h.inbounds {
err := inbound.Close()
if err != nil {
errs = append(errs, err)
}
}
if len(errs) != 0 {
return errors.Join(errs...)
}
return nil
}
func (h *Inbound) connHandler(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc) error {
if metadata.Destination != Destination {
h.router.RouteConnectionEx(ctx, conn, metadata, onClose)
+6 -2
View File
@@ -65,9 +65,13 @@ func NewFailover(ctx context.Context, router adapter.Router, logger log.ContextL
return outbound, nil
}
func (f *Failover) Start(stage adapter.StartStage) error {
func (f *Failover) Start(stage adapter.StartStage, scope *adapter.Scope) error {
for _, outbound := range f.outbounds {
err := adapter.LegacyStart(outbound, stage)
lifecycle, isLifecycle := outbound.(adapter.Lifecycle)
if !isLifecycle {
continue
}
err := scope.Start("outbound/"+outbound.Type()+"["+outbound.Tag()+"]", lifecycle, stage)
if err != nil {
return err
}