Get rid of superflous isActivateOnDemandEnabled key

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2018-12-21 18:50:32 +01:00
parent 8553723e04
commit ec031b1f19
7 changed files with 19 additions and 54 deletions
@@ -24,7 +24,6 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
networkMonitor?.cancel()
}
//swiftlint:disable:next function_body_length
override func startTunnel(options: [String: NSObject]?, completionHandler startTunnelCompletionHandler: @escaping (Error?) -> Void) {
let activationAttemptId = options?["activationAttemptId"] as? String
let errorNotifier = ErrorNotifier(activationAttemptId: activationAttemptId, tunnelProvider: self)
@@ -39,22 +38,8 @@ class PacketTunnelProvider: NEPacketTunnelProvider {
configureLogger()
let tunnelName = tunnelConfiguration.interface.name
wg_log(.info, message: "Starting tunnel '\(tunnelName)'")
wg_log(.info, message: "Starting tunnel '\(tunnelName)' from the " + (activationAttemptId == nil ? "OS directly, rather than the app" : "app"))
if activationAttemptId != nil {
wg_log(.info, staticMessage: "Tunnel activated from the app")
} else {
wg_log(.info, staticMessage: "Tunnel not activated from the app")
}
let isActivateOnDemandEnabled = tunnelProviderProtocol.isActivateOnDemandEnabled
if isActivateOnDemandEnabled {
wg_log(.info, staticMessage: "Tunnel has Activate On Demand enabled")
} else {
wg_log(.info, staticMessage: "Tunnel has Activate On Demand disabled")
}
errorNotifier.isActivateOnDemandEnabled = isActivateOnDemandEnabled
errorNotifier.tunnelName = tunnelName
let endpoints = tunnelConfiguration.peers.map { $0.endpoint }