diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2017-02-01 16:12:39 +0100 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2017-02-23 00:40:32 +0100 |
commit | ef57df5a4791f81871f2da42c1bb3086d0ed0815 (patch) | |
tree | 0b452947d4d9ad0076000af5e5e0f7957fabf71d /src/leap/bitmask/vpn/_control.py | |
parent | 1d4a3d68869dd9c416b104399097a6bb0c1bace3 (diff) |
[refactor] sort out some imports
Diffstat (limited to 'src/leap/bitmask/vpn/_control.py')
-rw-r--r-- | src/leap/bitmask/vpn/_control.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/leap/bitmask/vpn/_control.py b/src/leap/bitmask/vpn/_control.py index 82dd90b..6e942f4 100644 --- a/src/leap/bitmask/vpn/_control.py +++ b/src/leap/bitmask/vpn/_control.py @@ -1,3 +1,21 @@ + +import os + +from twisted.internet.task import LoopingCall +from twisted.internet import reactor +from twisted.logger import Logger + +from .process import VPNProcess +from .constants import IS_MAC + +logger = Logger() + +# NOTE: We need to set a bigger poll time in OSX because it seems +# openvpn malfunctions when you ask it a lot of things in a short +# amount of time. +POLL_TIME = 2.5 if IS_MAC else 1.0 + + class VPNControl(object): """ This is the high-level object that the service is dealing with. @@ -181,7 +199,7 @@ class VPNControl(object): and start the looping call for them. """ for poller in self._pollers: - poller.start(VPNManager.POLL_TIME) + poller.start(POLL_TIME) def _stop_pollers(self): |