From ea89052ef020bc237185bb672edcef7e6c9b4030 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Mon, 22 Apr 2024 20:55:37 -0600 Subject: [PATCH] fix issue with invalid third-party proxy ending up in the valid third-party list --- src/proxy/threads.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/proxy/threads.go b/src/proxy/threads.go index 650361a..f0b3ec2 100644 --- a/src/proxy/threads.go +++ b/src/proxy/threads.go @@ -78,15 +78,18 @@ func (p *ForwardProxyCluster) ValidateProxiesThread() { // Sort the proxy into the right groups. if isThirdparty(pxy) { - newThirdpartyOnlineProxies = append(newThirdpartyOnlineProxies, pxy) - + okToAdd := true for _, d := range config.GetConfig().ThirdpartyTestUrls { _, bv3hiErr := sendRequestThroughProxy(pxy, d) if bv3hiErr != nil { - log.Debugf("Validate - Third-party %s failed: %s", proxyHost, bv3hiErr) + okToAdd = false newThirdpartyBrokenProxies = append(newThirdpartyBrokenProxies, pxy) + log.Debugf("Validate - Third-party %s failed: %s", proxyHost, bv3hiErr) } } + if okToAdd { + newThirdpartyOnlineProxies = append(newThirdpartyOnlineProxies, pxy) + } } else { newOurOnlineProxies = append(newOurOnlineProxies, pxy) }