diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2022-04-16 09:28:44 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2022-04-29 10:30:26 +0200 |
| commit | 6789b1d4aeab47cb55d385feab6717b928743a01 (patch) | |
| tree | bd9bf86163481f6471ef397b102b96df27b27ea4 | |
| parent | 50f9ec7fce883df3cc76f8cbf011b62a92d88d38 (diff) | |
| download | mullvadvpn-6789b1d4aeab47cb55d385feab6717b928743a01.tar.xz mullvadvpn-6789b1d4aeab47cb55d385feab6717b928743a01.zip | |
REST: retrieve current endpoint instead of assuming that it stays the same
| -rw-r--r-- | ios/MullvadVPN/REST/RESTNetworkOperation.swift | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ios/MullvadVPN/REST/RESTNetworkOperation.swift b/ios/MullvadVPN/REST/RESTNetworkOperation.swift index 1d75bfe027..ddabf43459 100644 --- a/ios/MullvadVPN/REST/RESTNetworkOperation.swift +++ b/ios/MullvadVPN/REST/RESTNetworkOperation.swift @@ -113,14 +113,16 @@ extension REST { switch Self.evaluateError(error) { case .useNextEndpoint: - // Pick next endpoint in the event of network error + // Pick next endpoint in the event of network error. let nextEndpoint = addressCacheStore.selectNextEndpoint(endpoint) retryRequest(endpoint: nextEndpoint, previousResult: result, completionHandler: completionHandler) case .useCurrentEndpoint: - // Retry request using the same endpoint otherwise - retryRequest(endpoint: endpoint, previousResult: result, completionHandler: completionHandler) + // Retry request using current endpoint. + let currentEndpoint = addressCacheStore.getCurrentEndpoint() + + retryRequest(endpoint: currentEndpoint, previousResult: result, completionHandler: completionHandler) case .failImmediately: // Fail immediately in case of other errors, like server errors |
