1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 20:45:28 -05:00

fix usage of ray stream.

This commit is contained in:
Darien Raymond
2016-12-30 00:51:39 +01:00
parent 609dbc1f13
commit f6aa7a0053
9 changed files with 29 additions and 24 deletions

View File

@@ -109,7 +109,7 @@ func (v *Client) Dispatch(destination v2net.Destination, payload *buf.Buffer, ra
bufferedWriter.SetBuffered(false)
requestDone := signal.ExecuteAsync(func() error {
defer ray.OutboundInput().Release()
defer ray.OutboundInput().ForceClose()
if err := buf.PipeUntilEOF(ray.OutboundInput(), bodyWriter); err != nil {
return err
@@ -151,7 +151,7 @@ func (v *Client) Dispatch(destination v2net.Destination, payload *buf.Buffer, ra
}
requestDone := signal.ExecuteAsync(func() error {
defer ray.OutboundInput().Release()
defer ray.OutboundInput().ForceClose()
if err := buf.PipeUntilEOF(ray.OutboundInput(), writer); err != nil {
log.Info("Shadowsocks|Client: Failed to transport all UDP request: ", err)