mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-11 04:02:40 -03:00
Start the WebThread earlier than the Onion service. This gives it a chance to generate its slug before the Onion Service finishes starting up, which can otherwise lead to a crash
This commit is contained in:
parent
62804dfdce
commit
8b704a0070
1 changed files with 8 additions and 8 deletions
|
@ -41,14 +41,6 @@ class OnionThread(QtCore.QThread):
|
||||||
def run(self):
|
def run(self):
|
||||||
self.mode.common.log('OnionThread', 'run')
|
self.mode.common.log('OnionThread', 'run')
|
||||||
|
|
||||||
try:
|
|
||||||
self.mode.app.start_onion_service()
|
|
||||||
self.success.emit()
|
|
||||||
|
|
||||||
except (TorTooOld, TorErrorInvalidSetting, TorErrorAutomatic, TorErrorSocketPort, TorErrorSocketFile, TorErrorMissingPassword, TorErrorUnreadableCookieFile, TorErrorAuthError, TorErrorProtocolError, BundledTorTimeout, OSError) as e:
|
|
||||||
self.error.emit(e.args[0])
|
|
||||||
return
|
|
||||||
|
|
||||||
self.mode.app.stay_open = not self.mode.common.settings.get('close_after_first_download')
|
self.mode.app.stay_open = not self.mode.common.settings.get('close_after_first_download')
|
||||||
|
|
||||||
# start onionshare http service in new thread
|
# start onionshare http service in new thread
|
||||||
|
@ -58,6 +50,14 @@ class OnionThread(QtCore.QThread):
|
||||||
# wait for modules in thread to load, preventing a thread-related cx_Freeze crash
|
# wait for modules in thread to load, preventing a thread-related cx_Freeze crash
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.mode.app.start_onion_service()
|
||||||
|
self.success.emit()
|
||||||
|
|
||||||
|
except (TorTooOld, TorErrorInvalidSetting, TorErrorAutomatic, TorErrorSocketPort, TorErrorSocketFile, TorErrorMissingPassword, TorErrorUnreadableCookieFile, TorErrorAuthError, TorErrorProtocolError, BundledTorTimeout, OSError) as e:
|
||||||
|
self.error.emit(e.args[0])
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
class WebThread(QtCore.QThread):
|
class WebThread(QtCore.QThread):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue