mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 22:59:54 +01:00
Reset connection status when enabling network.
This commit is contained in:
@@ -495,17 +495,18 @@ class TorPlugin implements DuplexPlugin, EventHandler,
|
|||||||
|
|
||||||
private void enableNetwork(boolean enable) throws IOException {
|
private void enableNetwork(boolean enable) throws IOException {
|
||||||
if (!running) return;
|
if (!running) return;
|
||||||
|
if (networkEnabled == enable) return;
|
||||||
if (LOG.isLoggable(INFO)) LOG.info("Enabling network: " + enable);
|
if (LOG.isLoggable(INFO)) LOG.info("Enabling network: " + enable);
|
||||||
if (enable) wakeLock.acquire();
|
if (enable) wakeLock.acquire();
|
||||||
if (!enable) {
|
circuitBuilt.set(false);
|
||||||
circuitBuilt.set(false);
|
descriptorsPublished.set(0);
|
||||||
descriptorsPublished.set(0);
|
descriptorsPublishedTime = Long.MAX_VALUE;
|
||||||
descriptorsPublishedTime = Long.MAX_VALUE;
|
|
||||||
callback.transportDisabled();
|
|
||||||
}
|
|
||||||
networkEnabled = enable;
|
networkEnabled = enable;
|
||||||
controlConnection.setConf("DisableNetwork", enable ? "0" : "1");
|
controlConnection.setConf("DisableNetwork", enable ? "0" : "1");
|
||||||
if (!enable) wakeLock.release();
|
if (!enable) {
|
||||||
|
callback.transportDisabled();
|
||||||
|
wakeLock.release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stop() throws IOException {
|
public void stop() throws IOException {
|
||||||
|
|||||||
Reference in New Issue
Block a user