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:
Miguel Jacq 2018-09-19 15:07:04 +10:00
parent 62804dfdce
commit 8b704a0070
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6

View file

@ -41,14 +41,6 @@ class OnionThread(QtCore.QThread):
def run(self):
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')
# 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
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):
"""