commit 0d950796c4bc4cb026265955dd810c6195c74ffa
Author: n8fr8 <nathan(a)guardianproject.info>
Date: Wed May 26 14:04:25 2021 -0400
make calls to start and stop synchronized
---
.../src/main/java/org/torproject/android/service/OrbotService.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java b/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java
index ed463752..79c4aa85 100644
--- a/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java
+++ b/orbotservice/src/main/java/org/torproject/android/service/OrbotService.java
@@ -414,7 +414,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
/**
* 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");
@@ -731,7 +731,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
customEnv.add("TOR_PT_PROXY=socks5://" + OrbotVpnManager.sSocksProxyLocalhost + ":" + OrbotVpnManager.sSocksProxyServerPort);
}
- runTorShellCmd();
+ startTorService();
if (Prefs.hostOnionServicesEnabled()) {
try {
@@ -828,7 +828,7 @@ public class OrbotService extends VpnService implements TorServiceConstants, Orb
}
}
- private void runTorShellCmd() throws Exception {
+ private synchronized void startTorService() throws Exception {
updateTorConfigCustom(TorService.getDefaultsTorrc(this),
"DNSPort 0\n" +
"TransPort 0\n" +