mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-31 13:02:11 +00:00
Migrate old endpoints to new format
This commit is contained in:
parent
1904687a22
commit
d53e874cac
@ -263,7 +263,18 @@ public class ConnectionService: Codable {
|
||||
profile = try decoder.decode(ProviderConnectionProfile.self, from: data)
|
||||
|
||||
case .host:
|
||||
profile = try decoder.decode(HostConnectionProfile.self, from: data)
|
||||
let hostProfile = try decoder.decode(HostConnectionProfile.self, from: data)
|
||||
|
||||
// migrate old endpointProtocols
|
||||
if hostProfile.parameters.sessionConfiguration.endpointProtocols == nil {
|
||||
var sessionBuilder = hostProfile.parameters.sessionConfiguration.builder()
|
||||
sessionBuilder.endpointProtocols = hostProfile.parameters.endpointProtocols
|
||||
var parametersBuilder = hostProfile.parameters.builder()
|
||||
parametersBuilder.sessionConfiguration = sessionBuilder.build()
|
||||
hostProfile.parameters = parametersBuilder.build()
|
||||
}
|
||||
|
||||
profile = hostProfile
|
||||
}
|
||||
cache[key] = profile
|
||||
} catch let e {
|
||||
|
Loading…
Reference in New Issue
Block a user