Break proto string into components in the properties class instead of configuration class

This commit is contained in:
Sergey Abramchuk
2017-05-10 18:02:09 +03:00
parent a128cf248f
commit 90c6a18ba6
2 changed files with 2 additions and 3 deletions

View File

@@ -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);

View File

@@ -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;