mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 15:36:41 -05:00
handle empty payload
This commit is contained in:
parent
f64c79e239
commit
84740b676a
@ -142,9 +142,11 @@ func (this *Client) Dispatch(destination v2net.Destination, payload *alloc.Buffe
|
||||
Writer: conn,
|
||||
Request: request,
|
||||
}
|
||||
if !payload.IsEmpty() {
|
||||
if err := writer.Write(payload); err != nil {
|
||||
return errors.New("Shadowsocks|Client: Failed to write payload: " + err.Error())
|
||||
}
|
||||
}
|
||||
v2io.Pipe(ray.OutboundInput(), writer)
|
||||
|
||||
responseMutex.Lock()
|
||||
|
@ -23,7 +23,9 @@ func (this *OutboundConnectionHandler) Dispatch(destination v2net.Destination, p
|
||||
output := ray.OutboundOutput()
|
||||
|
||||
this.Destination = destination
|
||||
if !payload.IsEmpty() {
|
||||
this.ConnOutput.Write(payload.Value)
|
||||
}
|
||||
payload.Release()
|
||||
|
||||
writeFinish := &sync.Mutex{}
|
||||
|
Loading…
Reference in New Issue
Block a user