[Pkg-privacy-commits] [onionshare] 22/53: Cleanup ephemeral hidden services

Ulrike Uhlig u-guest at moszumanska.debian.org
Wed Dec 30 00:20:12 UTC 2015


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

u-guest pushed a commit to branch debian
in repository onionshare.

commit a5aff4605023ad155a3466eb2b513b058a1dcea2
Author: Micah Lee <micah at micahflee.com>
Date:   Sun Nov 15 16:26:44 2015 -0800

    Cleanup ephemeral hidden services
---
 onionshare/hs.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/onionshare/hs.py b/onionshare/hs.py
index 5d8dee1..368a866 100644
--- a/onionshare/hs.py
+++ b/onionshare/hs.py
@@ -36,6 +36,7 @@ class HS(object):
 
         # files and dirs to delete on shutdown
         self.cleanup_filenames = []
+        self.service_id = None
 
         # connect to the tor controlport
         self.c = None
@@ -60,6 +61,7 @@ class HS(object):
         if self.supports_ephemeral:
             print strings._('using_ephemeral')
             res = self.c.create_ephemeral_hidden_service({ 80: port }, await_publication = True)
+            self.service_id = res.content()[0][2].split('=')[1]
             onion_host = res.content()[0][2].split('=')[1] + '.onion'
             return onion_host
 
@@ -147,8 +149,11 @@ class HS(object):
 
     def cleanup(self):
         if self.supports_ephemeral:
-            # todo: cleanup the ephemeral hidden service
-            pass
+            # cleanup the ephemeral hidden service
+            if self.service_id:
+                self.c.remove_ephemeral_hidden_service(self.service_id)
+                self.service_id = None
+
         else:
             # cleanup hidden service
             try:

-- 
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