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