Let the Tor connection take a little longer (60s) if bridges are in use

This commit is contained in:
Miguel Jacq 2017-12-14 17:31:15 +11:00
parent 661cf7f129
commit 890acf9f38
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6

View File

@ -264,8 +264,13 @@ class Onion(object):
break break
time.sleep(0.2) time.sleep(0.2)
# Timeout after 45 seconds # If using bridges, it might take a bit longer to connect to Tor
if time.time() - start_ts > 45: if self.settings.get('tor_bridges_use_custom_bridges') or self.settings.get('tor_bridges_use_obfs4'):
connect_timeout = 60
else:
# Timeout after 45 seconds
connect_timeout = 45
if time.time() - start_ts > connect_timeout:
print("") print("")
self.tor_proc.terminate() self.tor_proc.terminate()
raise BundledTorTimeout(strings._('settings_error_bundled_tor_timeout')) raise BundledTorTimeout(strings._('settings_error_bundled_tor_timeout'))