diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2017-06-15 01:16:24 +0200 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2017-06-16 19:21:04 +0200 |
commit | da19f40ab42a7570d5a288239cc4dade56139082 (patch) | |
tree | 43cf469722c6c5fd272fcd9f3df0fd17c2a68201 /src/leap/bitmask/vpn/process.py | |
parent | f022da5cdbb8a128ccc4b11a2056ca711e984e6b (diff) |
[bug] reset traffic when stopping vpn
also, refactor a bit VPNManagement so that the `connect_to_management`
method does not receive connection details.
I plan to refactor management so that it is a separate object from the
control object (but we need to stablish better its relation with the
status parsing class).
- Resolves: #8834
Diffstat (limited to 'src/leap/bitmask/vpn/process.py')
-rw-r--r-- | src/leap/bitmask/vpn/process.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/leap/bitmask/vpn/process.py b/src/leap/bitmask/vpn/process.py index 844cd0f..d6e6129 100644 --- a/src/leap/bitmask/vpn/process.py +++ b/src/leap/bitmask/vpn/process.py @@ -76,13 +76,12 @@ class _VPNProcess(protocol.ProcessProtocol, _management.VPNManagement): openvpn invocation :type openvpn_verb: int """ + # TODO handle management as a component _management.VPNManagement.__init__(self) + self.set_connection(socket_host, socket_port) self._vpnconfig = vpnconfig self._providerconfig = providerconfig - self._socket_host = socket_host - self._socket_port = socket_port - self._launcher = get_vpn_launcher() self._last_state = None @@ -107,6 +106,10 @@ class _VPNProcess(protocol.ProcessProtocol, _management.VPNManagement): def traffic_status(self): return self._status.get_traffic_status() + @traffic_status.setter + def traffic_status(self, value): + self._status.set_traffic_status(value) + # processProtocol methods def connectionMade(self): @@ -203,8 +206,8 @@ class _VPNProcess(protocol.ProcessProtocol, _management.VPNManagement): command = self._launcher.get_vpn_command( vpnconfig=self._vpnconfig, providerconfig=self._providerconfig, - socket_host=self._socket_host, - socket_port=self._socket_port, + socket_host=self._host, + socket_port=self._port, openvpn_verb=self._openvpn_verb, remotes=self._remotes) |