mirror of
https://github.com/onionshare/onionshare.git
synced 2025-08-09 06:42:37 -04:00
Only set Censorship Circumvention bridges if we actually received some
This commit is contained in:
parent
4fbe981c31
commit
035c398f82
1 changed files with 9 additions and 8 deletions
|
@ -242,17 +242,18 @@ class CensorshipCircumvention(object):
|
||||||
# Should we attempt to iterate over each type if one of them fails to connect?
|
# Should we attempt to iterate over each type if one of them fails to connect?
|
||||||
# But if so, how to stop it starting 3 separate Tor connection threads?
|
# But if so, how to stop it starting 3 separate Tor connection threads?
|
||||||
# for bridges in request_bridges["settings"]:
|
# for bridges in request_bridges["settings"]:
|
||||||
bridges = bridge_settings["settings"][0]["bridges"]
|
if bridge_settings["settings"]:
|
||||||
bridge_strings = bridges["bridge_strings"]
|
bridges = bridge_settings["settings"][0]["bridges"]
|
||||||
|
bridge_strings = bridges["bridge_strings"]
|
||||||
|
|
||||||
self.settings.set("bridges_type", "custom")
|
self.settings.set("bridges_type", "custom")
|
||||||
|
|
||||||
# Sanity check the bridges provided from the Tor API before saving
|
# Sanity check the bridges provided from the Tor API before saving
|
||||||
bridges_checked = self.common.check_bridges_valid(bridge_strings)
|
bridges_checked = self.common.check_bridges_valid(bridge_strings)
|
||||||
|
|
||||||
if bridges_checked:
|
if bridges_checked:
|
||||||
self.settings.set("bridges_custom", "\n".join(bridges_checked))
|
self.settings.set("bridges_custom", "\n".join(bridges_checked))
|
||||||
bridges_ok = True
|
bridges_ok = True
|
||||||
|
|
||||||
# If we got any good bridges, save them to settings and return.
|
# If we got any good bridges, save them to settings and return.
|
||||||
if bridges_ok:
|
if bridges_ok:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue