XTLS Vision: Serialize VisionWriter writes from concurrent mux sessions (#7337)

https://github.com/XTLS/Xray-core/pull/7337#issuecomment-6692618802

Fixes https://github.com/XTLS/Xray-core/issues/7336

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
StarProxima
2026-11-06 18:45:23 +00:00
committed by GitHub
co-authored by 风扇滑翔翼 RPRX
parent 2e4c13d8c4
commit 1c8bf4067b
+5
View File
@@ -13,6 +13,7 @@ import (
"math/big"
"runtime"
"strconv"
"sync"
"time"
"github.com/pires/go-proxyproto"
@@ -301,6 +302,7 @@ type VisionWriter struct {
// internal
writeOnceUserUUID []byte
directWriteCounter stats.Counter
access sync.Mutex
testseed []uint32
}
@@ -324,6 +326,9 @@ func NewVisionWriter(writer buf.Writer, trafficState *TrafficState, isUplink boo
}
func (w *VisionWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
w.access.Lock()
defer w.access.Unlock()
var isPadding *bool
var switchToDirectCopy *bool
var spliceReadyInbound *session.Inbound