From 24653aef2156867f2a95cdaf394a7bc0e030415c Mon Sep 17 00:00:00 2001 From: v2ray Date: Tue, 15 Dec 2015 16:38:25 +0100 Subject: [PATCH] still close connection agressively --- proxy/freedom/freedom.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proxy/freedom/freedom.go b/proxy/freedom/freedom.go index e9f29035..c686db62 100644 --- a/proxy/freedom/freedom.go +++ b/proxy/freedom/freedom.go @@ -22,6 +22,7 @@ func (this *FreedomConnection) Dispatch(firstPacket v2net.Packet, ray ray.Outbou log.Error("Freedom: Failed to open connection: %s : %v", firstPacket.Destination().String(), err) return err } + defer conn.Close() input := ray.OutboundInput() output := ray.OutboundOutput() @@ -78,11 +79,10 @@ func (this *FreedomConnection) Dispatch(firstPacket v2net.Packet, ray ray.Outbou } writeMutex.Lock() - //if tcpConn, ok := conn.(*net.TCPConn); ok { - // tcpConn.CloseWrite() - //} + if tcpConn, ok := conn.(*net.TCPConn); ok { + tcpConn.CloseWrite() + } readMutex.Lock() - conn.Close() return nil }