mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-19 23:00:32 -04:00
Catch exception that occurs when stopping a web app that has not started (fixes #237)
This commit is contained in:
parent
9b83c3d959
commit
d67d5010d1
1 changed files with 10 additions and 7 deletions
|
@ -279,6 +279,7 @@ def stop(port):
|
|||
Stop the flask web server by loading /shutdown.
|
||||
"""
|
||||
# to stop flask, load http://127.0.0.1:<port>/<shutdown_slug>/shutdown
|
||||
try:
|
||||
if transparent_torification:
|
||||
import socket
|
||||
|
||||
|
@ -287,3 +288,5 @@ def stop(port):
|
|||
s.sendall('GET /{0:s}/shutdown HTTP/1.1\r\n\r\n'.format(shutdown_slug))
|
||||
else:
|
||||
urllib2.urlopen('http://127.0.0.1:{0:d}/{1:s}/shutdown'.format(port, shutdown_slug)).read()
|
||||
except:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue