[Pkg-privacy-commits] [onionshare] 02/66: Revert to using wait_for_hs for ephemeral HS

Ulrike Uhlig u-guest at moszumanska.debian.org
Wed Apr 13 22:17:45 UTC 2016


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

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

commit 9d5ba9b4f6a4b45462b8bce24ce6fbf8b679dcb6
Author: Garrett Robinson <garrett.f.robinson at gmail.com>
Date:   Tue Dec 22 23:09:30 2015 -0500

    Revert to using wait_for_hs for ephemeral HS
    
    Using `await_publication = True` blocks inside stem until the hidden
    service is published, which makes OnionShare appear to hang. This is a
    quick fix that reverts to using `wait_for_hs` for ephemeral hidden
    services (as well as non-ephemeral hidden services), which avoids
    blocking OnionShare.
---
 onionshare/hs.py                 | 2 +-
 onionshare/onionshare.py         | 7 +++----
 onionshare_gui/onionshare_gui.py | 5 ++---
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/onionshare/hs.py b/onionshare/hs.py
index 4857881..c770ddf 100644
--- a/onionshare/hs.py
+++ b/onionshare/hs.py
@@ -87,7 +87,7 @@ class HS(object):
         print strings._("connecting_ctrlport").format(int(port))
         if self.supports_ephemeral:
             print strings._('using_ephemeral')
-            res = self.c.create_ephemeral_hidden_service({ 80: port }, await_publication = True)
+            res = self.c.create_ephemeral_hidden_service({ 80: port }, await_publication = False)
             self.service_id = res.content()[0][2].split('=')[1]
             onion_host = res.content()[0][2].split('=')[1] + '.onion'
             return onion_host
diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py
index c3f8c50..edc7469 100644
--- a/onionshare/onionshare.py
+++ b/onionshare/onionshare.py
@@ -159,10 +159,9 @@ def main(cwd=None):
     try:  # Trap Ctrl-C
         # wait for hs, only if using old version of tor
         if not app.local_only:
-            if not app.hs.supports_ephemeral:
-                ready = app.hs.wait_for_hs(app.onion_host)
-                if not ready:
-                    sys.exit()
+            ready = app.hs.wait_for_hs(app.onion_host)
+            if not ready:
+                sys.exit()
 
         print strings._("give_this_url")
         print 'http://{0:s}/{1:s}'.format(app.onion_host, web.slug)
diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py
index 2be92ea..9c7a6db 100644
--- a/onionshare_gui/onionshare_gui.py
+++ b/onionshare_gui/onionshare_gui.py
@@ -169,9 +169,8 @@ class OnionShareGui(QtGui.QWidget):
 
             # wait for hs
             if not self.app.local_only:
-                if not self.app.hs.supports_ephemeral:
-                    self.status_bar.showMessage(strings._('gui_starting_server3', True))
-                    self.app.hs.wait_for_hs(self.app.onion_host)
+                self.status_bar.showMessage(strings._('gui_starting_server3', True))
+                self.app.hs.wait_for_hs(self.app.onion_host)
 
             # done
             self.start_server_finished.emit()

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