diff --git a/proxy/proxy.go b/proxy/proxy.go index 6008437eb..d57b47bce 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -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