From cf0adc27d6fb4e83816622bcfbf0ba53d0a6d7be Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 9 Jun 2015 10:49:10 -0400 Subject: [PATCH] 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. --- src/org/torproject/android/service/TorService.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java index 26a7df84..d56d09ab 100644 --- a/src/org/torproject/android/service/TorService.java +++ b/src/org/torproject/android/service/TorService.java @@ -167,8 +167,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon } - private boolean findExistingProc () - { + private boolean findExistingTorDaemon() { if (fileTor != null) { try @@ -631,7 +630,7 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon { try { - findExistingProc (); + findExistingTorDaemon(); } catch (Exception e) { @@ -1305,13 +1304,11 @@ public class TorService extends Service implements TorServiceConstants, OrbotCon try { - boolean found = findExistingProc (); + boolean found = findExistingTorDaemon(); if (!found) { - killProcess(fileTor); - killProcess(filePolipo); - + killAllDaemons(); startTor(); } }