1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-04 00:05:21 -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

@@ -28,7 +28,7 @@ type VMessOutboundHandler struct {
// Dispatch implements OutboundHandler.Dispatch().
func (v *VMessOutboundHandler) Dispatch(target v2net.Destination, payload *buf.Buffer, ray ray.OutboundRay) {
defer payload.Release()
defer ray.OutboundInput().Release()
defer ray.OutboundInput().ForceClose()
defer ray.OutboundOutput().Close()
var rec *protocol.ServerSpec
@@ -83,7 +83,7 @@ func (v *VMessOutboundHandler) Dispatch(target v2net.Destination, payload *buf.B
session := encoding.NewClientSession(protocol.DefaultIDHash)
requestDone := signal.ExecuteAsync(func() error {
defer input.Release()
defer input.ForceClose()
writer := bufio.NewWriter(conn)
defer writer.Release()