aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-14 00:01:41 +0530
committerRoopesh Chander <roop@roopc.net>2018-12-14 00:40:18 +0530
commit501e412b84848a098f3f3724c8d4586c473e294a (patch)
tree676a7be067941e4bc713870664b878479cce2fe1
parentLocalize swiftlint (diff)
downloadwireguard-apple-501e412b84848a098f3f3724c8d4586c473e294a.tar.xz
wireguard-apple-501e412b84848a098f3f3724c8d4586c473e294a.zip
TunnelsManager: startActivation() need not take a tunnelConfiguration
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r--WireGuard/WireGuard/Tunnel/TunnelsManager.swift14
1 files changed, 3 insertions, 11 deletions
diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
index 64f694ba..40d86629 100644
--- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
+++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
@@ -362,16 +362,8 @@ class TunnelContainer: NSObject {
self.isActivateOnDemandEnabled = self.tunnelProvider.isOnDemandEnabled
}
- fileprivate func startActivation(activationDelegate: TunnelsManagerActivationDelegate?) {
- assert(status == .inactive || status == .restarting || status == .waiting)
-
- guard let tunnelConfiguration = tunnelConfiguration() else { fatalError() }
-
- startActivation(tunnelConfiguration: tunnelConfiguration, activationDelegate: activationDelegate)
- }
-
//swiftlint:disable:next function_body_length
- fileprivate func startActivation(recursionCount: UInt = 0, lastError: Error? = nil, tunnelConfiguration: TunnelConfiguration, activationDelegate: TunnelsManagerActivationDelegate?) {
+ fileprivate func startActivation(recursionCount: UInt = 0, lastError: Error? = nil, activationDelegate: TunnelsManagerActivationDelegate?) {
if recursionCount >= 8 {
wg_log(.error, message: "startActivation: Failed after 8 attempts. Giving up with \(lastError!)")
activationDelegate?.tunnelActivationAttemptFailed(tunnel: self, error: .failedBecauseOfTooManyErrors)
@@ -397,7 +389,7 @@ class TunnelContainer: NSObject {
wg_log(.debug, staticMessage: "startActivation: Tunnel saved after re-enabling")
wg_log(.debug, staticMessage: "startActivation: Invoking startActivation")
self.startActivation(recursionCount: recursionCount + 1, lastError: NEVPNError(NEVPNError.configurationUnknown),
- tunnelConfiguration: tunnelConfiguration, activationDelegate: activationDelegate)
+ activationDelegate: activationDelegate)
}
return
}
@@ -434,7 +426,7 @@ class TunnelContainer: NSObject {
}
wg_log(.debug, staticMessage: "startActivation: Tunnel reloaded")
wg_log(.debug, staticMessage: "startActivation: Invoking startActivation")
- self.startActivation(recursionCount: recursionCount + 1, lastError: systemError, tunnelConfiguration: tunnelConfiguration, activationDelegate: activationDelegate)
+ self.startActivation(recursionCount: recursionCount + 1, lastError: systemError, activationDelegate: activationDelegate)
}
}
}