mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 12:19:54 +01:00
Close small gap between setStarted() and setDisabledBySettings().
This commit is contained in:
@@ -836,7 +836,6 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
state.setDisabledBySettings(disabledBySettings, reasonDisabled);
|
state.setDisabledBySettings(disabledBySettings, reasonDisabled);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -866,6 +865,7 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
|
|||||||
networkEnabled = false,
|
networkEnabled = false,
|
||||||
bootstrapped = false,
|
bootstrapped = false,
|
||||||
circuitBuilt = false,
|
circuitBuilt = false,
|
||||||
|
settingsChecked = false,
|
||||||
disabledBySettings = false;
|
disabledBySettings = false;
|
||||||
|
|
||||||
@GuardedBy("this")
|
@GuardedBy("this")
|
||||||
@@ -914,6 +914,7 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
|
|||||||
|
|
||||||
synchronized void setDisabledBySettings(boolean disabledBySettings,
|
synchronized void setDisabledBySettings(boolean disabledBySettings,
|
||||||
int reasonDisabled) {
|
int reasonDisabled) {
|
||||||
|
settingsChecked = true;
|
||||||
this.disabledBySettings = disabledBySettings;
|
this.disabledBySettings = disabledBySettings;
|
||||||
this.reasonDisabled = reasonDisabled;
|
this.reasonDisabled = reasonDisabled;
|
||||||
callback.pluginStateChanged(getState());
|
callback.pluginStateChanged(getState());
|
||||||
@@ -932,7 +933,9 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
synchronized State getState() {
|
synchronized State getState() {
|
||||||
if (!started || stopped || disabledBySettings) return DISABLED;
|
if (!started || stopped || !settingsChecked || disabledBySettings) {
|
||||||
|
return DISABLED;
|
||||||
|
}
|
||||||
if (!networkInitialised) return ENABLING;
|
if (!networkInitialised) return ENABLING;
|
||||||
if (!networkEnabled) return INACTIVE;
|
if (!networkEnabled) return INACTIVE;
|
||||||
return bootstrapped && circuitBuilt ? ACTIVE : ENABLING;
|
return bootstrapped && circuitBuilt ? ACTIVE : ENABLING;
|
||||||
|
|||||||
Reference in New Issue
Block a user