mirror of https://github.com/v2ray/v2ray-core
handle empty payload
parent
f64c79e239
commit
84740b676a
|
@ -142,8 +142,10 @@ func (this *Client) Dispatch(destination v2net.Destination, payload *alloc.Buffe
|
||||||
Writer: conn,
|
Writer: conn,
|
||||||
Request: request,
|
Request: request,
|
||||||
}
|
}
|
||||||
if err := writer.Write(payload); err != nil {
|
if !payload.IsEmpty() {
|
||||||
return errors.New("Shadowsocks|Client: Failed to write payload: " + err.Error())
|
if err := writer.Write(payload); err != nil {
|
||||||
|
return errors.New("Shadowsocks|Client: Failed to write payload: " + err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
v2io.Pipe(ray.OutboundInput(), writer)
|
v2io.Pipe(ray.OutboundInput(), writer)
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,9 @@ func (this *OutboundConnectionHandler) Dispatch(destination v2net.Destination, p
|
||||||
output := ray.OutboundOutput()
|
output := ray.OutboundOutput()
|
||||||
|
|
||||||
this.Destination = destination
|
this.Destination = destination
|
||||||
this.ConnOutput.Write(payload.Value)
|
if !payload.IsEmpty() {
|
||||||
|
this.ConnOutput.Write(payload.Value)
|
||||||
|
}
|
||||||
payload.Release()
|
payload.Release()
|
||||||
|
|
||||||
writeFinish := &sync.Mutex{}
|
writeFinish := &sync.Mutex{}
|
||||||
|
|
Loading…
Reference in New Issue