From 90c6a18ba66220ef5f9ae916ec7cd64631bc304e Mon Sep 17 00:00:00 2001 From: Sergey Abramchuk Date: Wed, 10 May 2017 18:02:09 +0300 Subject: [PATCH] Break proto string into components in the properties class instead of configuration class --- OpenVPN Adapter/OpenVPNConfiguration.mm | 3 +-- OpenVPN Adapter/OpenVPNProperties.mm | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenVPN Adapter/OpenVPNConfiguration.mm b/OpenVPN Adapter/OpenVPNConfiguration.mm index adf8356..f742709 100644 --- a/OpenVPN Adapter/OpenVPNConfiguration.mm +++ b/OpenVPN Adapter/OpenVPNConfiguration.mm @@ -57,8 +57,7 @@ NSString *const OpenVPNTLSCertProfileDefaultValue = @"default"; OpenVPNTransportProtocolDefaultValue: @(OpenVPNTransportProtocolDefault) }; - NSString *currentValue = [value length] == 0 ? OpenVPNTransportProtocolDefaultValue : - [[value componentsSeparatedByString:@"-"] firstObject]; + NSString *currentValue = [value length] == 0 ? OpenVPNTransportProtocolDefaultValue :value; NSNumber *transportProtocol = options[currentValue]; NSAssert(transportProtocol != nil, @"Incorrect protocol value: %@", currentValue); diff --git a/OpenVPN Adapter/OpenVPNProperties.mm b/OpenVPN Adapter/OpenVPNProperties.mm index edf54a7..2dca5e5 100644 --- a/OpenVPN Adapter/OpenVPNProperties.mm +++ b/OpenVPN Adapter/OpenVPNProperties.mm @@ -40,7 +40,7 @@ using namespace openvpn; _remotePort = port; - NSString *currentProto = [NSString stringWithUTF8String:eval.remoteProto.c_str()]; + NSString *currentProto = [[[NSString stringWithUTF8String:eval.remoteProto.c_str()] componentsSeparatedByString:@"-"] firstObject]; _remoteProto = [OpenVPNConfiguration getTransportProtocolFromValue:currentProto]; _servers = nil;