From 053d03349a5e9510c36ea5d020ec645ed46d1383 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sun, 1 Apr 2018 09:58:45 +0200 Subject: [PATCH] refactor --- proxy/shadowsocks/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/shadowsocks/client.go b/proxy/shadowsocks/client.go index 9d103cc7..8cb20d6d 100644 --- a/proxy/shadowsocks/client.go +++ b/proxy/shadowsocks/client.go @@ -38,7 +38,7 @@ func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) { } // Process implements OutboundHandler.Process(). -func (v *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error { +func (c *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error { destination, ok := proxy.TargetFromContext(ctx) if !ok { return newError("target not specified") @@ -49,7 +49,7 @@ func (v *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, diale var conn internet.Connection err := retry.ExponentialBackoff(5, 100).On(func() error { - server = v.serverPicker.PickServer() + server = c.serverPicker.PickServer() dest := server.Destination() dest.Network = network rawConn, err := dialer.Dial(ctx, dest) @@ -90,7 +90,7 @@ func (v *Client) Process(ctx context.Context, outboundRay ray.OutboundRay, diale request.Option |= RequestOptionOneTimeAuth } - sessionPolicy := v.v.PolicyManager().ForLevel(user.Level) + sessionPolicy := c.v.PolicyManager().ForLevel(user.Level) ctx, cancel := context.WithCancel(ctx) timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle)