[Pkg-privacy-commits] [onionshare] 07/12: Catch exception that occurs when stopping a web app that has not started (fixes #237)

Ulrike Uhlig u-guest at moszumanska.debian.org
Mon Jan 4 17:08:40 UTC 2016


This is an automated email from the git hooks/post-receive script.

u-guest pushed a commit to branch debian
in repository onionshare.

commit d67d5010d190b15b8cb0eb3da4209b07061c3f01
Author: Micah Lee <micah at micahflee.com>
Date:   Mon Dec 7 15:03:53 2015 -0800

    Catch exception that occurs when stopping a web app that has not started (fixes #237)
---
 onionshare/web.py | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/onionshare/web.py b/onionshare/web.py
index 8956581..623509a 100644
--- a/onionshare/web.py
+++ b/onionshare/web.py
@@ -279,11 +279,14 @@ def stop(port):
     Stop the flask web server by loading /shutdown.
     """
     # to stop flask, load http://127.0.0.1:<port>/<shutdown_slug>/shutdown
-    if transparent_torification:
-        import socket
-
-        s = socket.socket()
-        s.connect(('127.0.0.1', 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()
+    try:
+        if transparent_torification:
+            import socket
+
+            s = socket.socket()
+            s.connect(('127.0.0.1', 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git



More information about the Pkg-privacy-commits mailing list