[Pkg-privacy-commits] [onionshare] 138/256: Make sure tor process is killed in a more robust manner, and also increase tor connection timeout to 45 seconds

Ulrike Uhlig ulrike at moszumanska.debian.org
Fri May 26 12:53:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

ulrike pushed a commit to branch master
in repository onionshare.

commit e4cdfa6c994bd4827439aaf816644425500853df
Author: Micah Lee <micah at micahflee.com>
Date:   Sat Apr 15 11:43:19 2017 -0700

    Make sure tor process is killed in a more robust manner, and also increase tor connection timeout to 45 seconds
---
 onionshare/onion.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/onionshare/onion.py b/onionshare/onion.py
index d0908cb..07c516b 100644
--- a/onionshare/onion.py
+++ b/onionshare/onion.py
@@ -136,7 +136,7 @@ class Onion(object):
         (self.tor_path, self.tor_geo_ip_file_path, self.tor_geo_ipv6_file_path) = helpers.get_tor_paths()
 
         # The tor process
-        self.tor_p = None
+        self.tor_proc = None
 
         # Try to connect to Tor
         self.c = None
@@ -215,8 +215,8 @@ class Onion(object):
                     break
                 time.sleep(0.2)
 
-                # Timeout after 30 seconds
-                if time.time() - start_ts > 30:
+                # Timeout after 45 seconds
+                if time.time() - start_ts > 45:
                     print("")
                     self.tor_proc.terminate()
                     raise BundledTorTimeout(strings._('settings_error_bundled_tor_timeout'))
@@ -387,6 +387,9 @@ class Onion(object):
         # Stop tor process
         if self.tor_proc:
             self.tor_proc.terminate()
+            time.sleep(0.2)
+            if not self.tor_proc.poll():
+                self.tor_proc.kill()
             self.tor_proc = None
 
     def _get_available_port(self):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git



More information about the Pkg-privacy-commits mailing list