mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-29 01:06:16 -05:00
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.
This commit is contained in:
parent
41a30dd4e4
commit
9d5ba9b4f6
@ -87,7 +87,7 @@ class HS(object):
|
|||||||
print strings._("connecting_ctrlport").format(int(port))
|
print strings._("connecting_ctrlport").format(int(port))
|
||||||
if self.supports_ephemeral:
|
if self.supports_ephemeral:
|
||||||
print strings._('using_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]
|
self.service_id = res.content()[0][2].split('=')[1]
|
||||||
onion_host = res.content()[0][2].split('=')[1] + '.onion'
|
onion_host = res.content()[0][2].split('=')[1] + '.onion'
|
||||||
return onion_host
|
return onion_host
|
||||||
|
@ -159,7 +159,6 @@ def main(cwd=None):
|
|||||||
try: # Trap Ctrl-C
|
try: # Trap Ctrl-C
|
||||||
# wait for hs, only if using old version of tor
|
# wait for hs, only if using old version of tor
|
||||||
if not app.local_only:
|
if not app.local_only:
|
||||||
if not app.hs.supports_ephemeral:
|
|
||||||
ready = app.hs.wait_for_hs(app.onion_host)
|
ready = app.hs.wait_for_hs(app.onion_host)
|
||||||
if not ready:
|
if not ready:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
@ -169,7 +169,6 @@ class OnionShareGui(QtGui.QWidget):
|
|||||||
|
|
||||||
# wait for hs
|
# wait for hs
|
||||||
if not self.app.local_only:
|
if not self.app.local_only:
|
||||||
if not self.app.hs.supports_ephemeral:
|
|
||||||
self.status_bar.showMessage(strings._('gui_starting_server3', True))
|
self.status_bar.showMessage(strings._('gui_starting_server3', True))
|
||||||
self.app.hs.wait_for_hs(self.app.onion_host)
|
self.app.hs.wait_for_hs(self.app.onion_host)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user