From a4b8a71c68fb160740beaec298c49b546037df78 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 9 Nov 2017 07:12:00 +1100 Subject: [PATCH] remove shutdown_timeout logic in the web server, it's not actually needed --- onionshare/__init__.py | 2 +- onionshare/web.py | 11 +---------- onionshare_gui/onionshare_gui.py | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/onionshare/__init__.py b/onionshare/__init__.py index 5371f8ab..138c03a5 100644 --- a/onionshare/__init__.py +++ b/onionshare/__init__.py @@ -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() diff --git a/onionshare/web.py b/onionshare/web.py index 55d4a96f..5705bf90 100644 --- a/onionshare/web.py +++ b/onionshare/web.py @@ -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'): diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index d629bd58..151d2468 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -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