Commit a9309318 authored by Torsten Grote's avatar Torsten Grote

Disable TorPlugin before applying changed settings

The is necessary for two reasons:

1. Since Tor, it doesn't reconnect when changing the value of
   UseBridges via the control connection without also resetting
2. The TorPlugin needs to set itself to a disconnected state for the UI
   to properly reflect this new state

Fixes #1420
parent e776ee02
......@@ -627,6 +627,9 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
if (s.getNamespace().equals(ID.getString())) {"Tor settings updated");
settings = s.getSettings();
// Works around a bug introduced in Tor Could be
// replaced with callback.transportDisabled() when fixed.
} else if (e instanceof NetworkStatusEvent) {
......@@ -634,6 +637,16 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
private void disableNetwork() {
connectionStatusExecutor.execute(() -> {
try {
} catch (IOException ex) {
logException(LOG, WARNING, ex);
private void updateConnectionStatus(NetworkStatus status) {
connectionStatusExecutor.execute(() -> {
if (!running) return;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment