Commit 4222ee22 authored by Davide De Rosa's avatar Davide De Rosa
Browse files

Improve custom cfg code

parent 4784c748
......@@ -174,11 +174,11 @@ public class PIATunnelProfile: NetworkExtensionProfile {
cfg.providerBundleIdentifier = bundleIdentifier
var customCfg = configuration.customConfiguration
if let piaCfg = customCfg as? PIATunnelProvider.Configuration,
let bestAddress = configuration.server.bestOpenVPNAddressForUDP?.hostname { // XXX: UDP address = TCP address
if let piaCfg = customCfg as? PIATunnelProvider.Configuration {
var builder = piaCfg.builder()
builder.resolvedAddresses = [bestAddress]
if let bestAddress = configuration.server.bestOpenVPNAddressForUDP?.hostname { // XXX: UDP address = TCP address
builder.resolvedAddresses = [bestAddress]
}
customCfg = builder.build()
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment