aboutsummaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-04-25 17:41:41 -0400
committerGitHub <noreply@github.com>2021-04-25 17:41:41 -0400
commit2e44dfbbdaf44ceb024a08ce44050e5a194f8e45 (patch)
treed6a23de31dfafb83254c9f390a78a96405b6704c /cli
parent6ef93c764ffbd6bab27502ba1bc3330ec9633a09 (diff)
parenta4ae37d203a87cb6c07a676a02679d6d13164dfe (diff)
downloadonionshare-2e44dfbbdaf44ceb024a08ce44050e5a194f8e45.tar.gz
onionshare-2e44dfbbdaf44ceb024a08ce44050e5a194f8e45.zip
Merge pull request #1330 from SaptakS/chat-socket-fix
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.