Fix: missing proxies

This commit is contained in:
kayos@tcp.direct 2023-01-31 02:39:31 -08:00
parent cd7067a868
commit 25c45c57d5
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
2 changed files with 1 additions and 5 deletions

View File

@ -33,7 +33,6 @@ func (p5 *ProxyEngine) getSocksStr(proto ProxyProtocol) string {
time.Sleep(250 * time.Millisecond)
continue
case !p5.stillGood(sock):
sock = nil
continue
default:
p5.stats.dispense()
@ -68,10 +67,10 @@ func (p5 *ProxyEngine) GetHTTPTunnel() string {
// GetAnySOCKS retrieves any version SOCKS proxy as a Proxy type
// Will block if one is not available!
func (p5 *ProxyEngine) GetAnySOCKS() *Proxy {
var sock *Proxy
defer p5.stats.dispense()
for {
var sock *Proxy
select {
case <-p5.ctx.Done():
return nil
@ -90,7 +89,6 @@ func (p5 *ProxyEngine) GetAnySOCKS() *Proxy {
case p5.stillGood(sock):
return sock
default:
sock = nil
}
continue
}

View File

@ -115,7 +115,6 @@ func (p5 *ProxyEngine) mysteryDialer(ctx context.Context, network, addr string)
conn, err := dialSocks(network, addr)
if err != nil {
count++
atomic.StoreUint32(&sock.lock, stateUnlocked)
p5.msgUnableToReach(socksString, addr, err)
continue
}
@ -130,7 +129,6 @@ func (p5 *ProxyEngine) mysteryDialer(ctx context.Context, network, addr string)
_ = conn.Close()
}
}()
atomic.StoreUint32(&sock.lock, stateUnlocked)
return conn, nil
}
}