Commit 35cd1d4d authored by Ulysse Beaugnon's avatar Ulysse Beaugnon

Replace .kill() with .terminate() to terminate subprocesses

parent e661f4d5
...@@ -121,7 +121,7 @@ class TunnelManager: ...@@ -121,7 +121,7 @@ class TunnelManager:
utils.log('Killing the connection with %s...' % (prefix,), 2) utils.log('Killing the connection with %s...' % (prefix,), 2)
connection = self._connection_dict.pop(prefix) connection = self._connection_dict.pop(prefix)
try: try:
connection.process.kill() connection.process.terminate()
except OSError: except OSError:
# If the process is already exited # If the process is already exited
pass pass
......
...@@ -165,22 +165,22 @@ def main(): ...@@ -165,22 +165,22 @@ def main():
forwarder.refresh() forwarder.refresh()
except KeyboardInterrupt: except KeyboardInterrupt:
try: try:
router.kill() router.terminate()
except: except:
pass pass
try: try:
server_process.kill() server_process.terminate()
except: except:
pass pass
tunnel_manager.killAll() tunnel_manager.killAll()
return 0 return 0
except: except:
try: try:
router.kill() router.terminate()
except: except:
pass pass
try: try:
server_process.kill() server_process.terminate()
except: except:
pass pass
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment