on start and tor daemon not running, kill all daemons before starting again

To make sure there are not any other daemons still running when trying to
start the whole thing again, kill all daemons before starting tor afresh.
This commit is contained in:
Hans-Christoph Steiner 2015-06-09 10:49:10 -04:00
parent 2bc85a4a3a
commit cf0adc27d6
1 changed files with 4 additions and 7 deletions

View File

@ -167,8 +167,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
} }
private boolean findExistingProc () private boolean findExistingTorDaemon() {
{
if (fileTor != null) if (fileTor != null)
{ {
try try
@ -631,7 +630,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
{ {
try try
{ {
findExistingProc (); findExistingTorDaemon();
} }
catch (Exception e) catch (Exception e)
{ {
@ -1305,13 +1304,11 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon
try try
{ {
boolean found = findExistingProc (); boolean found = findExistingTorDaemon();
if (!found) if (!found)
{ {
killProcess(fileTor); killAllDaemons();
killProcess(filePolipo);
startTor(); startTor();
} }
} }