diff --git a/daemons.go b/daemons.go index a4ea864..6e4bf0d 100644 --- a/daemons.go +++ b/daemons.go @@ -124,8 +124,15 @@ func (p5 *ProxyEngine) jobSpawner() { continue } + var sock *Proxy + p5.Pending.Lock() - sock := p5.Pending.Remove(p5.Pending.Front()).(*Proxy) + switch p5.GetRecyclingStatus() { + case true: + el := p5.Pending.Front() + p5.Pending.MoveToBack(el) + sock = el.Value.(*Proxy) + } p5.Pending.Unlock() _ = p5.scale() diff --git a/defs.go b/defs.go index b5ea1b5..6f89146 100644 --- a/defs.go +++ b/defs.go @@ -68,7 +68,7 @@ type ProxyEngine struct { stats *Statistics Status uint32 - + // Pending is a constant stream of proxy strings to be verified Pending proxyList diff --git a/mr_worldwide.go b/mr_worldwide.go index 0431f00..3d87ba1 100644 --- a/mr_worldwide.go +++ b/mr_worldwide.go @@ -32,9 +32,10 @@ func (p5 *ProxyEngine) newHTTPClient() any { }, } - if timeout != time.Unix(0, 0) { + if timeout != time.Duration(0) { hc.Timeout = timeout } + return hc } // GetHTTPClient retrieves a pointer to an http.Client powered by mysteryDialer.