Skip to content

Commit 334a24e

Browse files
committed
Merge branch 'fix-encrypted-dns-rotation-strategy-ios-1037'
2 parents c778787 + 831fb52 commit 334a24e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

ios/MullvadREST/Transport/TransportProvider.swift

+12-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import Foundation
1010
import Logging
11+
import MullvadRustRuntime
1112
import MullvadTypes
1213

1314
public final class TransportProvider: RESTTransportProvider, Sendable {
@@ -38,7 +39,8 @@ public final class TransportProvider: RESTTransportProvider, Sendable {
3839

3940
let currentStrategy = transportStrategy
4041
return TransportWrapper(wrapped: actualTransport) { [weak self] error in
41-
if let error = error as? URLError, error.shouldResetNetworkTransport {
42+
if (error as? URLError)?.shouldResetNetworkTransport ?? false ||
43+
(error as? EncryptedDnsProxyError)?.shouldResetNetworkTransport ?? false {
4244
self?.resetTransportMatching(currentStrategy)
4345
}
4446
}
@@ -104,6 +106,15 @@ public final class TransportProvider: RESTTransportProvider, Sendable {
104106
}
105107
}
106108

109+
private extension EncryptedDnsProxyError {
110+
var shouldResetNetworkTransport: Bool {
111+
switch self {
112+
case .start:
113+
return true
114+
}
115+
}
116+
}
117+
107118
private extension URLError {
108119
/// Whether the transport selection should be reset.
109120
///

ios/MullvadRustRuntime/EncryptedDNSProxy.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010
import MullvadRustRuntimeProxy
1111

12-
enum EncryptedDnsProxyError: Error {
12+
public enum EncryptedDnsProxyError: Error {
1313
case start(err: Int32)
1414
}
1515

0 commit comments

Comments
 (0)