remove shutdown_timeout logic in the web server, it's not actually needed

This commit is contained in:
Miguel Jacq 2017-11-09 07:12:00 +11:00
parent 32108dcca2
commit a4b8a71c68
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6
3 changed files with 3 additions and 12 deletions

View file

@ -108,7 +108,7 @@ def main(cwd=None):
print('')
# Start OnionShare http service in new thread
t = threading.Thread(target=web.start, args=(app.port, app.stay_open, app.shutdown_timeout))
t = threading.Thread(target=web.start, args=(app.port, app.stay_open))
t.daemon = True
t.start()

View file

@ -135,14 +135,6 @@ def get_stay_open():
"""
return stay_open
shutdown_timeout = 0
def set_shutdown_timeout(new_shutdown_timeout):
"""
Set shutdown_timeout variable.
"""
global shutdown_timeout
shutdown_timeout = new_shutdown_timeout
# Are we running in GUI mode?
gui_mode = False
def set_gui_mode():
@ -368,14 +360,13 @@ def force_shutdown():
func()
def start(port, stay_open=False, shutdown_timeout=0):
def start(port, stay_open=False):
"""
Start the flask web server.
"""
generate_slug()
set_stay_open(stay_open)
set_shutdown_timeout(shutdown_timeout)
# In Whonix, listen on 0.0.0.0 instead of 127.0.0.1 (#220)
if os.path.exists('/usr/share/anon-ws-base-files/workstation'):

View file

@ -258,7 +258,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
self.app.stay_open = not self.settings.get('close_after_first_download')
# start onionshare http service in new thread
t = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open, self.app.shutdown_timeout))
t = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open))
t.daemon = True
t.start()
# wait for modules in thread to load, preventing a thread-related cx_Freeze crash