Reinstate the alternative method of shutting down the web server - necessary for clicking 'Stop sharing' from GUI

This commit is contained in:
Miguel Jacq 2017-05-20 17:37:12 +10:00
parent d3eeda887b
commit 3641f376b7
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6

View File

@ -371,4 +371,7 @@ def stop(port):
s.connect(('127.0.0.1', port))
s.sendall('GET /{0:s}/shutdown HTTP/1.1\r\n\r\n'.format(shutdown_slug))
except:
pass
try:
urlopen('http://127.0.0.1:{0:d}/{1:s}/shutdown'.format(port, shutdown_slug)).read()
except:
pass