From d9aabb980b83e5f3622a3fd9ab19cc4b51104899 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 23 Jun 2022 00:31:49 +0200 Subject: remove mutex, handle thread safety outside --- client/client.go | 7 ------- 1 file changed, 7 deletions(-) (limited to 'client') diff --git a/client/client.go b/client/client.go index 482f66f..9263aac 100644 --- a/client/client.go +++ b/client/client.go @@ -1,6 +1,5 @@ // Package client exposes a socks5 proxy that uses obfs4 to communicate with the server, // with an optional kcp wire transport. - package client import ( @@ -8,7 +7,6 @@ import ( "fmt" "log" "net" - "sync" "0xacab.org/leap/obfsvpn" @@ -27,7 +25,6 @@ type Client struct { obfs4Cert string server *socks5.Server started bool - mu sync.Mutex } func NewClient(kcp bool, socksAddr, obfs4Cert string) *Client { @@ -39,8 +36,6 @@ func NewClient(kcp bool, socksAddr, obfs4Cert string) *Client { } func (c *Client) Start() (bool, error) { - c.mu.Lock() - defer c.mu.Unlock() if c.started { log.Printf("Cannot start proxy server, already running") @@ -78,8 +73,6 @@ func (c *Client) Start() (bool, error) { } func (c *Client) Stop() (bool, error) { - c.mu.Lock() - defer c.mu.Unlock() if !c.started || c.server == nil { return false, ErrNotRunning -- cgit v1.2.3