Make it impossible to cancel a share mid-startup, to avoid a thread segfault issue. Only autostart mode can cancel a share (after it is scheduled)

This commit is contained in:
Miguel Jacq 2021-05-31 10:35:02 +10:00
parent 2c73c0b1b0
commit 64c7f4e5b8
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6
3 changed files with 2 additions and 10 deletions

View File

@ -33,7 +33,7 @@
"gui_show_url_qr_code": "Show QR Code",
"gui_qr_code_dialog_title": "OnionShare QR Code",
"gui_waiting_to_start": "Scheduled to start in {}. Click to cancel.",
"gui_please_wait": "Starting… Click to cancel.",
"gui_please_wait": "Starting…",
"error_rate_limit": "Someone has made too many wrong attempts to guess your password, so OnionShare has stopped the server. Start sharing again and send the recipient a new address to share.",
"zip_progress_bar_format": "Compressing: %p%",
"gui_settings_window_title": "Settings",

View File

@ -354,14 +354,6 @@ class Mode(QtWidgets.QWidget):
self.app.onion.scheduled_key = None
self.app.onion.scheduled_auth_cookie = None
self.startup_thread.quit()
if self.onion_thread:
self.common.log("Mode", "cancel_server: quitting onion thread")
self.onion_thread.terminate()
self.onion_thread.wait()
if self.web_thread:
self.common.log("Mode", "cancel_server: quitting web thread")
self.web_thread.terminate()
self.web_thread.wait()
self.stop_server()
def cancel_server_custom(self):

View File

@ -379,7 +379,7 @@ class ServerStatus(QtWidgets.QWidget):
self.start_server()
elif self.status == self.STATUS_STARTED:
self.stop_server()
elif self.status == self.STATUS_WORKING:
elif self.status == self.STATUS_WORKING and self.settings.get("general", "autostart_timer"):
self.cancel_server()
self.button_clicked.emit()