1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

dont reuse shadowsock connections

This commit is contained in:
Darien Raymond 2016-11-02 22:18:25 +01:00
parent 68b85cce60
commit c5a92e00ef
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,8 @@ func (this *Client) Dispatch(destination v2net.Destination, payload *alloc.Buffe
} }
log.Info("Shadowsocks|Client: Tunneling request to ", destination, " via ", server.Destination()) log.Info("Shadowsocks|Client: Tunneling request to ", destination, " via ", server.Destination())
conn.SetReusable(false)
request := &protocol.RequestHeader{ request := &protocol.RequestHeader{
Version: Version, Version: Version,
Address: destination.Address, Address: destination.Address,

View File

@ -146,6 +146,7 @@ func (this *Server) handlerUDPPayload(payload *alloc.Buffer, session *proxy.Sess
func (this *Server) handleConnection(conn internet.Connection) { func (this *Server) handleConnection(conn internet.Connection) {
defer conn.Close() defer conn.Close()
conn.SetReusable(false)
timedReader := v2net.NewTimeOutReader(16, conn) timedReader := v2net.NewTimeOutReader(16, conn)
defer timedReader.Release() defer timedReader.Release()