Merge pull request #768 from mig5/start_web_thread_earlier_than_onion_service

Start the WebThread earlier than the Onion service. This gives it a c…
This commit is contained in:
Micah Lee 2018-09-19 18:03:04 -07:00 committed by GitHub
commit fe9b510a9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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):
"""