mirror of https://github.com/v2ray/v2ray-core
handle empty payload in freedom and outbound
parent
cc92973daf
commit
66bb7879e0
|
@ -99,7 +99,9 @@ func (this *FreedomConnection) Dispatch(destination v2net.Destination, payload *
|
||||||
readMutex.Lock()
|
readMutex.Lock()
|
||||||
writeMutex.Lock()
|
writeMutex.Lock()
|
||||||
|
|
||||||
conn.Write(payload.Value)
|
if !payload.IsEmpty() {
|
||||||
|
conn.Write(payload.Value)
|
||||||
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
v2writer := v2io.NewAdaptiveWriter(conn)
|
v2writer := v2io.NewAdaptiveWriter(conn)
|
||||||
|
|
|
@ -97,8 +97,10 @@ func (this *VMessOutboundHandler) handleRequest(session *encoding.ClientSession,
|
||||||
if request.Option.Has(protocol.RequestOptionChunkStream) {
|
if request.Option.Has(protocol.RequestOptionChunkStream) {
|
||||||
streamWriter = vmessio.NewAuthChunkWriter(streamWriter)
|
streamWriter = vmessio.NewAuthChunkWriter(streamWriter)
|
||||||
}
|
}
|
||||||
if err := streamWriter.Write(payload); err != nil {
|
if !payload.IsEmpty() {
|
||||||
conn.SetReusable(false)
|
if err := streamWriter.Write(payload); err != nil {
|
||||||
|
conn.SetReusable(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
writer.SetCached(false)
|
writer.SetCached(false)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue