1
0
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:
v2ray 2016-08-15 12:23:35 +02:00
parent cc92973daf
commit 66bb7879e0
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -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)