[Pkg-anonymity-tools] [onionshare] 92/140: Fix CLI version to automatically exit when the server is shut down.

Ulrike Uhlig u-guest at moszumanska.debian.org
Mon Sep 29 20:33:51 UTC 2014


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

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

commit e33cfd621d4d2bee8a690a0757b93c19d2e6d2dd
Author: kkka <kkka at users.noreply.github.com>
Date:   Sun Sep 7 10:33:52 2014 +0900

    Fix CLI version to automatically exit when the server is shut down.
---
 onionshare/onionshare.py | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/onionshare/onionshare.py b/onionshare/onionshare.py
index bf8bf84..73c5a81 100644
--- a/onionshare/onionshare.py
+++ b/onionshare/onionshare.py
@@ -254,16 +254,13 @@ def main():
     print strings._("ctrlc_to_stop")
 
     # wait for app to close
-    running = True
-    while running:
-        try:
-            time.sleep(0.5)
-        except KeyboardInterrupt:
-            running = False
-            web.stop()
-
-    # shutdown
-    app.cleanup()
+    try:
+        t.join()
+    except KeyboardInterrupt:
+        web.stop(app.port)
+    finally:
+        # shutdown
+        app.cleanup()
 
 if __name__ == '__main__':
     main()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/onionshare.git



More information about the Pkg-anonymity-tools mailing list