Skip to content
Snippets Groups Projects
Unverified Commit f58ee132 authored by akwizgran's avatar akwizgran
Browse files

Reset connection status when enabling network.

parent 63d849b6
No related branches found
No related tags found
No related merge requests found
......@@ -495,17 +495,18 @@ class TorPlugin implements DuplexPlugin, EventHandler,
private void enableNetwork(boolean enable) throws IOException {
if (!running) return;
if (networkEnabled == enable) return;
if (LOG.isLoggable(INFO)) LOG.info("Enabling network: " + enable);
if (enable) wakeLock.acquire();
circuitBuilt.set(false);
descriptorsPublished.set(0);
descriptorsPublishedTime = Long.MAX_VALUE;
networkEnabled = enable;
controlConnection.setConf("DisableNetwork", enable ? "0" : "1");
if (!enable) {
circuitBuilt.set(false);
descriptorsPublished.set(0);
descriptorsPublishedTime = Long.MAX_VALUE;
callback.transportDisabled();
wakeLock.release();
}
networkEnabled = enable;
controlConnection.setConf("DisableNetwork", enable ? "0" : "1");
if (!enable) wakeLock.release();
}
public void stop() throws IOException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment