Преглед изворни кода

dont reuse shadowsock connections

Darien Raymond пре 9 година
родитељ
комит
c5a92e00ef
2 измењених фајлова са 3 додато и 0 уклоњено
  1. 2 0
      proxy/shadowsocks/client.go
  2. 1 0
      proxy/shadowsocks/server.go

+ 2 - 0
proxy/shadowsocks/client.go

@@ -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())
 
+	conn.SetReusable(false)
+
 	request := &protocol.RequestHeader{
 		Version: Version,
 		Address: destination.Address,

+ 1 - 0
proxy/shadowsocks/server.go

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