mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-11-07 18:52:37 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47a10c0012 |
@@ -51,17 +51,7 @@ func (m *Manager) AddHandler(ctx context.Context, handler inbound.Handler) error
|
|||||||
}
|
}
|
||||||
|
|
||||||
if m.running {
|
if m.running {
|
||||||
if err := handler.Start(); err != nil {
|
return handler.Start()
|
||||||
if len(tag) > 0 {
|
|
||||||
delete(m.taggedHandlers, tag)
|
|
||||||
} else {
|
|
||||||
m.untaggedHandlers = m.untaggedHandlers[:len(m.untaggedHandlers)-1]
|
|
||||||
}
|
|
||||||
if err := handler.Close(); err != nil {
|
|
||||||
errors.LogWarningInner(ctx, err, "failed to close handler ", tag)
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
|
|||||||
if config.Concurrency < 0 {
|
if config.Concurrency < 0 {
|
||||||
h.mux = &mux.ClientManager{Enabled: false}
|
h.mux = &mux.ClientManager{Enabled: false}
|
||||||
}
|
}
|
||||||
if config.Concurrency >= 0 && config.Concurrency <= 128 {
|
if config.Concurrency == 0 {
|
||||||
config.Concurrency = 128
|
config.Concurrency = 8 // same as before
|
||||||
}
|
}
|
||||||
if config.Concurrency > 0 {
|
if config.Concurrency > 0 {
|
||||||
h.mux = &mux.ClientManager{
|
h.mux = &mux.ClientManager{
|
||||||
@@ -134,7 +134,7 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
|
|||||||
Dialer: h,
|
Dialer: h,
|
||||||
Strategy: mux.ClientStrategy{
|
Strategy: mux.ClientStrategy{
|
||||||
MaxConcurrency: uint32(config.Concurrency),
|
MaxConcurrency: uint32(config.Concurrency),
|
||||||
MaxConnection: 1024,
|
MaxConnection: 128,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -155,7 +155,7 @@ func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (outbou
|
|||||||
Dialer: h,
|
Dialer: h,
|
||||||
Strategy: mux.ClientStrategy{
|
Strategy: mux.ClientStrategy{
|
||||||
MaxConcurrency: uint32(config.XudpConcurrency),
|
MaxConcurrency: uint32(config.XudpConcurrency),
|
||||||
MaxConnection: 1024,
|
MaxConnection: 128,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import (
|
|||||||
"math/big"
|
"math/big"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pires/go-proxyproto"
|
"github.com/pires/go-proxyproto"
|
||||||
@@ -302,7 +301,6 @@ type VisionWriter struct {
|
|||||||
// internal
|
// internal
|
||||||
writeOnceUserUUID []byte
|
writeOnceUserUUID []byte
|
||||||
directWriteCounter stats.Counter
|
directWriteCounter stats.Counter
|
||||||
access sync.Mutex
|
|
||||||
|
|
||||||
testseed []uint32
|
testseed []uint32
|
||||||
}
|
}
|
||||||
@@ -326,9 +324,6 @@ func NewVisionWriter(writer buf.Writer, trafficState *TrafficState, isUplink boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
||||||
w.access.Lock()
|
|
||||||
defer w.access.Unlock()
|
|
||||||
|
|
||||||
var isPadding *bool
|
var isPadding *bool
|
||||||
var switchToDirectCopy *bool
|
var switchToDirectCopy *bool
|
||||||
var spliceReadyInbound *session.Inbound
|
var spliceReadyInbound *session.Inbound
|
||||||
|
|||||||
Reference in New Issue
Block a user