From 3641f376b7caa99389155a159620273d97decb67 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sat, 20 May 2017 17:37:12 +1000 Subject: [PATCH] Reinstate the alternative method of shutting down the web server - necessary for clicking 'Stop sharing' from GUI --- onionshare/web.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/onionshare/web.py b/onionshare/web.py index 2ff60bd2..a4abfccf 100644 --- a/onionshare/web.py +++ b/onionshare/web.py @@ -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