mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-11-18 11:04:28 +00: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()
|
readMutex.Lock()
|
||||||
writeMutex.Lock()
|
writeMutex.Lock()
|
||||||
|
|
||||||
|
if !payload.IsEmpty() {
|
||||||
conn.Write(payload.Value)
|
conn.Write(payload.Value)
|
||||||
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
v2writer := v2io.NewAdaptiveWriter(conn)
|
v2writer := v2io.NewAdaptiveWriter(conn)
|
||||||
|
|||||||
@ -97,9 +97,11 @@ 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 !payload.IsEmpty() {
|
||||||
if err := streamWriter.Write(payload); err != nil {
|
if err := streamWriter.Write(payload); err != nil {
|
||||||
conn.SetReusable(false)
|
conn.SetReusable(false)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
writer.SetCached(false)
|
writer.SetCached(false)
|
||||||
|
|
||||||
err := v2io.Pipe(input, streamWriter)
|
err := v2io.Pipe(input, streamWriter)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user