From 5551c59e50d70626a5cfb0f7efbffa0657498d9f Mon Sep 17 00:00:00 2001 From: Nathan Freitas Date: Thu, 17 Apr 2014 10:16:56 -0400 Subject: [PATCH] fixes to ensure service does not block --- src/org/torproject/android/service/TorService.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 7f889c01..441bd1ed 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -738,6 +738,9 @@ public class TorService extends Service implements TorServiceConstants, TorConst String torrcPath = new File(appBinHome, TORRC_ASSET_KEY).getAbsolutePath(); + // if (ENABLE_DEBUG_LOG) + // torrcPath = new File(appBinHome, TORRCDIAG_ASSET_KEY).getAbsolutePath(); + boolean transProxyTethering = prefs.getBoolean("pref_transparent_tethering", false); if (transProxyTethering) @@ -745,7 +748,6 @@ public class TorService extends Service implements TorServiceConstants, TorConst torrcPath = new File(appBinHome, TORRC_TETHER_KEY).getAbsolutePath(); } - int procId = -1; int torRetryWaitTimeMS = 1000; @@ -759,11 +761,6 @@ public class TorService extends Service implements TorServiceConstants, TorConst SimpleCommand cmdTor = new SimpleCommand(fileTor.getAbsolutePath() + " DataDirectory " + appCacheHome.getAbsolutePath() + " -f " + torrcPath + " &"); shell.add(cmdTor); - if (TorService.ENABLE_DEBUG_LOG) - { - logNotice("Tor exit code=" + cmdTor.getExitCode() + ";output=" + cmdTor.getOutput()); - } - //wait a few seconds Thread.sleep(torRetryWaitTimeMS); @@ -1393,7 +1390,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst } catch (IOException ioe){ - logMessage("error requesting newny: " + ioe.getLocalizedMessage()); + logMessage("error requesting newnym: " + ioe.getLocalizedMessage()); } } }.start(); @@ -1502,7 +1499,7 @@ public class TorService extends Service implements TorServiceConstants, TorConst } - private synchronized void sendCallbackLogMessage (String logMessage) + private void sendCallbackLogMessage (String logMessage) { if (mCallbacks == null)