mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 06:39:54 +01:00
Don't assume Tor has bootstrapped if it's already running.
This commit is contained in:
@@ -138,8 +138,6 @@ class TorPlugin implements DuplexPlugin, EventHandler {
|
|||||||
controlSocket.close();
|
controlSocket.close();
|
||||||
killZombieProcess();
|
killZombieProcess();
|
||||||
startProcess = true;
|
startProcess = true;
|
||||||
} else {
|
|
||||||
bootstrapped = true;
|
|
||||||
}
|
}
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
LOG.info("Tor is not running");
|
LOG.info("Tor is not running");
|
||||||
@@ -220,6 +218,14 @@ class TorPlugin implements DuplexPlugin, EventHandler {
|
|||||||
// Register to receive events from the Tor process
|
// Register to receive events from the Tor process
|
||||||
controlConnection.setEventHandler(this);
|
controlConnection.setEventHandler(this);
|
||||||
controlConnection.setEvents(Arrays.asList(EVENTS));
|
controlConnection.setEvents(Arrays.asList(EVENTS));
|
||||||
|
// If Tor was already running, find out whether it's bootstrapped
|
||||||
|
if(!startProcess) {
|
||||||
|
String phase = controlConnection.getInfo("status/bootstrap-phase");
|
||||||
|
if(phase != null && phase.contains("PROGRESS=100")) {
|
||||||
|
LOG.info("Tor has already bootstrapped");
|
||||||
|
bootstrapped = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Register to receive network status events
|
// Register to receive network status events
|
||||||
networkStateReceiver = new NetworkStateReceiver();
|
networkStateReceiver = new NetworkStateReceiver();
|
||||||
IntentFilter filter = new IntentFilter(CONNECTIVITY_ACTION);
|
IntentFilter filter = new IntentFilter(CONNECTIVITY_ACTION);
|
||||||
|
|||||||
Reference in New Issue
Block a user