aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorSaptak S <saptak013@gmail.com>2021-04-19 02:59:22 +0530
committerSaptak S <saptak013@gmail.com>2021-04-19 02:59:22 +0530
commita4ae37d203a87cb6c07a676a02679d6d13164dfe (patch)
tree8c2c8ffdabd488ff6611e471c3d0c102f58d191d /cli
parent530f9547f5ac28e68e83ed827d334f66de99bdc4 (diff)
downloadonionshare-a4ae37d203a87cb6c07a676a02679d6d13164dfe.tar.gz
onionshare-a4ae37d203a87cb6c07a676a02679d6d13164dfe.zip
Force shutdowns the socket server on closing chat server
Diffstat (limited to 'cli')
-rw-r--r--cli/onionshare_cli/web/web.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cli/onionshare_cli/web/web.py b/cli/onionshare_cli/web/web.py
index 7408046b..ab47195c 100644
--- a/cli/onionshare_cli/web/web.py
+++ b/cli/onionshare_cli/web/web.py
@@ -360,13 +360,18 @@ class Web:
# Shutdown the flask service
try:
func = request.environ.get("werkzeug.server.shutdown")
- if func is None:
+ if func is None and self.mode != "chat":
raise RuntimeError("Not running with the Werkzeug Server")
func()
except:
pass
+
self.running = False
+ # If chat, shutdown the socket server
+ if self.mode == "chat":
+ self.socketio.stop()
+
def start(self, port):
"""
Start the flask web server.