aboutsummaryrefslogtreecommitdiff
path: root/cli/onionshare_cli/web/share_mode.py
diff options
context:
space:
mode:
Diffstat (limited to 'cli/onionshare_cli/web/share_mode.py')
-rw-r--r--cli/onionshare_cli/web/share_mode.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/cli/onionshare_cli/web/share_mode.py b/cli/onionshare_cli/web/share_mode.py
index f714081d..a5fb79f0 100644
--- a/cli/onionshare_cli/web/share_mode.py
+++ b/cli/onionshare_cli/web/share_mode.py
@@ -181,7 +181,6 @@ class ShareModeWeb(SendBaseModeWeb):
# Prepare some variables to use inside generate() function below
# which is outside of the request context
- shutdown_func = request.environ.get("werkzeug.server.shutdown")
request_path = request.path
# If this is a zipped file, then serve as-is. If it's not zipped, then,
@@ -218,7 +217,6 @@ class ShareModeWeb(SendBaseModeWeb):
else:
r = Response(
self.generate(
- shutdown_func,
range_,
file_to_download,
request_path,
@@ -303,7 +301,7 @@ class ShareModeWeb(SendBaseModeWeb):
return range_, status_code
def generate(
- self, shutdown_func, range_, file_to_download, path, history_id, filesize
+ self, range_, file_to_download, path, history_id, filesize
):
# The user hasn't canceled the download
self.client_cancel = False
@@ -390,9 +388,7 @@ class ShareModeWeb(SendBaseModeWeb):
print("Stopped because transfer is complete")
self.web.running = False
try:
- if shutdown_func is None:
- raise RuntimeError("Not running with the Werkzeug Server")
- shutdown_func()
+ self.web.stop()
except Exception:
pass