Commit d4184890 authored by Davide De Rosa's avatar Davide De Rosa
Browse files

Drop redundant migration to automatic socket type

An old tunnelConfiguration without endpointProtocols will be
parsed to nil and therefore fall back to defaults, that is
AppConfiguration.shared.piaDefaultConfigurationBuilder. This will
override any former user UDP/TCP preference, but it's not a big

Such builder has endpointProtocols properly set to automatic, so:

- tunnelConfiguration will never be nil, it'll be set to defaults.
- Default endpointProtocols will never be empty.

As a consequence, the code will never be executed.
parent 8e620ad9
......@@ -107,18 +107,6 @@ class Bootstrapper {
pref.mace = false
// automatic
let tunnelConfiguration = pref.vpnCustomConfiguration(for: PIATunnelProfile.vpnType) as? PIATunnelProvider.Configuration
if tunnelConfiguration?.endpointProtocols.isEmpty ?? true {
AppPreferences.shared.piaSocketType = nil
var tunnelConfigurationBuilder = tunnelConfiguration?.builder()
tunnelConfigurationBuilder?.endpointProtocols = AppConfiguration.VPN.piaAutomaticProtocols
if let newConfiguration = tunnelConfigurationBuilder?.build() {
pref.setVPNCustomConfiguration(newConfiguration, for: PIATunnelProfile.vpnType)
// Business objects
Markdown is supported
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