[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] small tweaks to Tor binary startup code



commit cc020f54b6cb4ab0ccd974009b38eddb86da194d
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date:   Tue Apr 15 00:25:28 2014 -0400

    small tweaks to Tor binary startup code
---
 src/org/torproject/android/service/TorService.java |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java
index 52e4061..e8688c2 100644
--- a/src/org/torproject/android/service/TorService.java
+++ b/src/org/torproject/android/service/TorService.java
@@ -734,16 +734,24 @@ public class TorService extends Service implements TorServiceConstants, TorConst
 
 		int torRetryWaitTimeMS = 1000;
 		
-		ArrayList<String> alEnv = new ArrayList<String>();
-		alEnv.add("HOME=" + appBinHome.getAbsolutePath());
-		
 		sendCallbackStatusMessage(getString(R.string.status_starting_up));
 		
+		//start Tor in the background
+		ArrayList<String> alEnv = new ArrayList<String>();
+		alEnv.add("HOME=" + appBinHome.getAbsolutePath());
 		Shell shell = Shell.startShell(alEnv,appBinHome.getAbsolutePath());
-		SimpleCommand cmdTor = new SimpleCommand(fileTor.getAbsolutePath() + " DataDirectory " + appCacheHome.getAbsolutePath() + " -f " + torrcPath + "&");
+		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);
 
+		//now try to connect
 		procId = initControlConnection ();
 
 		shell.close();



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits