diff --git a/server/main.go b/server/main.go index 2be21c0..fda01c8 100644 --- a/server/main.go +++ b/server/main.go @@ -14,7 +14,7 @@ import ( ) var ( - version = "2.0.3" + version = "2.0.4" // cmd line options configFile *string diff --git a/server/proxy/proxy.go b/server/proxy/proxy.go index 1001f4a..394b43b 100644 --- a/server/proxy/proxy.go +++ b/server/proxy/proxy.go @@ -283,8 +283,12 @@ func (p *Proxy) handleNotification(notif []byte) { } func (p *Proxy) connect(minerName string) error { - // p.connMu.Lock() - // defer p.connMu.Unlock() + p.connMu.Lock() + defer p.connMu.Unlock() + + if p.isClosed { + return errors.New("using closed proxy error") + } var conn net.Conn var socks5Dialer proxy.Dialer diff --git a/server/tcp/server.go b/server/tcp/server.go index 4a12555..9f9211e 100644 --- a/server/tcp/server.go +++ b/server/tcp/server.go @@ -47,7 +47,7 @@ func StartServer() { if err != nil { logger.Get().Println("Unable to accept connection: ", err) } - conn.SetReadDeadline(time.Now().Add(45 * time.Second)) + conn.SetReadDeadline(time.Now().Add(90 * time.Second)) // if !limit.Allow() { // logger.Get().Println("Out of rate limit:", rl, "per 25 ms.")