From a6324ae48d187ee812cb0be9f1bd29e00f23f54b Mon Sep 17 00:00:00 2001 From: Nikita Kryuchkov Date: Tue, 12 Nov 2019 04:18:16 +0300 Subject: [PATCH] Fix argument order --- cmd/apps/therealproxy-client/therealproxy-client.go | 2 +- internal/therealproxy/client.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/apps/therealproxy-client/therealproxy-client.go b/cmd/apps/therealproxy-client/therealproxy-client.go index 643d55ff8a..96c9079cb3 100644 --- a/cmd/apps/therealproxy-client/therealproxy-client.go +++ b/cmd/apps/therealproxy-client/therealproxy-client.go @@ -60,7 +60,7 @@ func main() { clientTimeout = defaultTimeout } - client, err := therealproxy.NewClient(clientTimeout, l, socksApp, remote) + client, err := therealproxy.NewClient(l, socksApp, remote, clientTimeout) if err != nil { log.Fatal("Failed to create a new client: ", err) } diff --git a/internal/therealproxy/client.go b/internal/therealproxy/client.go index 0000133f2f..655051f2f9 100644 --- a/internal/therealproxy/client.go +++ b/internal/therealproxy/client.go @@ -20,20 +20,20 @@ var Log = logging.MustGetLogger("therealproxy") // Client implement multiplexing proxy client using yamux. type Client struct { - timeout time.Duration - session *yamux.Session listener net.Listener app *app.App addr routing.Addr + timeout time.Duration + session *yamux.Session } // NewClient constructs a new Client. -func NewClient(timeout time.Duration, lis net.Listener, app *app.App, addr routing.Addr) (*Client, error) { +func NewClient(lis net.Listener, app *app.App, addr routing.Addr, timeout time.Duration) (*Client, error) { c := &Client{ - timeout: timeout, listener: lis, app: app, addr: addr, + timeout: timeout, } if err := c.connect(); err != nil { return nil, err