diff options
Diffstat (limited to 'searx/network')
-rw-r--r-- | searx/network/network.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/searx/network/network.py b/searx/network/network.py index c9af97649..69af3b7c4 100644 --- a/searx/network/network.py +++ b/searx/network/network.py @@ -167,13 +167,14 @@ class Network: for transport in client._mounts.values(): # pylint: disable=protected-access if isinstance(transport, AsyncHTTPTransportNoHttp): continue - if not getattr(transport, '_rdns', False): - result = False - break - else: - response = await client.get('https://check.torproject.org/api/ip') - if not response.json()['IsTor']: - result = False + if getattr(transport, "_pool") and getattr( + transport._pool, "_rdns", False # pylint: disable=protected-access + ): + continue + return False + response = await client.get("https://check.torproject.org/api/ip", timeout=10) + if not response.json()["IsTor"]: + result = False Network._TOR_CHECK_RESULT[proxies] = result return result |