Skip to content

Commit

Permalink
make calls to start and stop synchronized
Browse files Browse the repository at this point in the history
  • Loading branch information
n8fr8 committed May 26, 2021
1 parent 18fc045 commit 0d95079
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ private void stopSnowflakeProxy () {
/**
* if someone stops during startup, we may have to wait for the conn port to be setup, so we can properly shutdown tor
*/
private void stopTor() throws Exception {
private synchronized void stopTor() throws Exception {

if (conn != null) {
logNotice("Using control port to shutdown Tor");
Expand Down Expand Up @@ -731,7 +731,7 @@ private void startTor() {
customEnv.add("TOR_PT_PROXY=socks5://" + OrbotVpnManager.sSocksProxyLocalhost + ":" + OrbotVpnManager.sSocksProxyServerPort);
}

runTorShellCmd();
startTorService();

if (Prefs.hostOnionServicesEnabled()) {
try {
Expand Down Expand Up @@ -828,7 +828,7 @@ private void updateLegacyV2OnionNames() throws SecurityException {
}
}

private void runTorShellCmd() throws Exception {
private synchronized void startTorService() throws Exception {
updateTorConfigCustom(TorService.getDefaultsTorrc(this),
"DNSPort 0\n" +
"TransPort 0\n" +
Expand Down

0 comments on commit 0d95079

Please sign in to comment.