mirror of
https://github.com/onionshare/onionshare.git
synced 2025-04-14 04:43:12 -04:00
Merge pull request #245 from garrettr/wait-for-ephemeral-hs
Revert to using wait_for_hs for ephemeral HS
This commit is contained in:
commit
4c40b89faf
@ -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
|
||||
|
@ -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)
|
||||
|
@ -168,9 +168,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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user