summaryrefslogtreecommitdiffhomepage
path: root/ios/PacketTunnelCore
diff options
context:
space:
mode:
authormojganii <mojgan.jelodar@mullvad.net>2025-05-19 15:40:39 +0200
committerBug Magnet <marco.nikic@mullvad.net>2025-05-21 11:33:19 +0200
commit1e06f244cc4e0b04da080be13b9b177d1a74ff3c (patch)
treeac37027dd27c1e56c351d230f488f02e18ed9289 /ios/PacketTunnelCore
parentc5bd16efa266871b3a67b1153d34b42ceb560bae (diff)
downloadmullvadvpn-1e06f244cc4e0b04da080be13b9b177d1a74ff3c.tar.xz
mullvadvpn-1e06f244cc4e0b04da080be13b9b177d1a74ff3c.zip
Remove dead code and add some more comments
Diffstat (limited to 'ios/PacketTunnelCore')
-rw-r--r--ios/PacketTunnelCore/Actor/PacketTunnelActor+KeyPolicy.swift36
1 files changed, 0 insertions, 36 deletions
diff --git a/ios/PacketTunnelCore/Actor/PacketTunnelActor+KeyPolicy.swift b/ios/PacketTunnelCore/Actor/PacketTunnelActor+KeyPolicy.swift
index 3c2619ca07..52ae8c54d9 100644
--- a/ios/PacketTunnelCore/Actor/PacketTunnelActor+KeyPolicy.swift
+++ b/ios/PacketTunnelCore/Actor/PacketTunnelActor+KeyPolicy.swift
@@ -40,17 +40,6 @@ extension PacketTunnelActor {
}
/**
- Switch key policy from `.usePrior` to `.useCurrent` policy and reconnect the tunnel.
-
- Next reconnection attempt will read the new key from settings.
- */
- func switchToCurrentKey() {
- if switchToCurrentKeyInner() {
- eventChannel.send(.reconnect(.random))
- }
- }
-
- /**
Start a task that will wait for the new key to propagate across relays (see `PacketTunnelActorTimings.wgKeyPropagationDelay`) and then:
1. Switch `keyPolicy` back to `.useCurrent`.
@@ -70,29 +59,4 @@ extension PacketTunnelActor {
return AutoCancellingTask(task)
}
-
- /**
- Switch key policy from `.usePrior` to `.useCurrent` policy.
-
- - Returns: `true` if the tunnel should reconnect, otherwise `false`.
- */
- private func switchToCurrentKeyInner() -> Bool {
- let oldKeyPolicy = state.keyPolicy
- state.mutateKeyPolicy(setCurrentKeyPolicy)
- // Prevent tunnel from reconnecting when in blocked state.
- guard case .error = state else { return state.keyPolicy != oldKeyPolicy }
- return false
- }
-
- /**
- Internal helper that transitions key policy from `.usePrior` to `.useCurrent`.
-
- - Parameter keyPolicy: a reference to key policy held either in connection state or blocked state struct.
- - Returns: `true` when the policy was modified, otherwise `false`.
- */
- private func setCurrentKeyPolicy(_ keyPolicy: inout State.KeyPolicy) {
- if case .usePrior = keyPolicy {
- keyPolicy = .useCurrent
- }
- }
}