update convension
This commit is contained in:
parent
bc21d68e5a
commit
8078e59a83
2 changed files with 7 additions and 34 deletions
|
|
@ -181,10 +181,8 @@ extension PacketTunnelProvider: OpenVPNAdapterDelegate {
|
|||
ipv6Settings.includedRoutes = [ipv6DefaultRoute]
|
||||
NSLog("[Route] Added default IPv6 route (::/0)")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Set the network settings for the current tunneling session.
|
||||
setTunnelNetworkSettings(networkSettings, completionHandler: completionHandler)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,6 @@ bool IosController::initialize()
|
|||
|
||||
bool IosController::connectVpn(amnezia::Proto proto, const QJsonObject& configuration)
|
||||
{
|
||||
|
||||
m_proto = proto;
|
||||
m_rawConfig = configuration;
|
||||
m_serverAddress = configuration.value(config_key::hostName).toString().toNSString();
|
||||
|
|
@ -130,8 +129,6 @@ bool IosController::connectVpn(amnezia::Proto proto, const QJsonObject& configur
|
|||
if (proto == amnezia::Proto::OpenVpn) {
|
||||
QJsonObject ovpn = configuration["openvpn_config_data"].toObject();
|
||||
QString ovpnConfig = ovpn["config"].toString();
|
||||
|
||||
// Danh sách directive không hỗ trợ từng dòng
|
||||
QStringList unsupportedDirectives = {
|
||||
"resolv-retry",
|
||||
"persist-key",
|
||||
|
|
@ -142,9 +139,6 @@ bool IosController::connectVpn(amnezia::Proto proto, const QJsonObject& configur
|
|||
|
||||
QStringList lines = ovpnConfig.split('\n');
|
||||
QStringList filteredLines;
|
||||
|
||||
bool insideTlsAuthBlock = false;
|
||||
|
||||
for (const QString &line : lines) {
|
||||
QString trimmedLine = line.trimmed();
|
||||
|
||||
|
|
@ -160,16 +154,11 @@ bool IosController::connectVpn(amnezia::Proto proto, const QJsonObject& configur
|
|||
filteredLines.append(line);
|
||||
}
|
||||
}
|
||||
|
||||
// Nối lại cấu hình đã lọc
|
||||
ovpnConfig = filteredLines.join("\n");
|
||||
|
||||
// Gán lại vào config JSON
|
||||
ovpn["config"] = ovpnConfig;
|
||||
m_rawConfig["openvpn_config_data"] = ovpn;
|
||||
}
|
||||
|
||||
|
||||
QString tunnelName;
|
||||
if (configuration.value(config_key::description).toString().isEmpty()) {
|
||||
tunnelName = QString("%1 %2")
|
||||
|
|
@ -303,8 +292,6 @@ void IosController::vpnStatusDidChange(void *pNotification)
|
|||
{
|
||||
NETunnelProviderSession *session = (NETunnelProviderSession *)pNotification;
|
||||
|
||||
qDebug() << "IosController::vpnStatusDidChange - Session pointer:" << session;
|
||||
|
||||
if (session /* && session == TunnelManager.session */ ) {
|
||||
qDebug() << "IosController::vpnStatusDidChange" << iosStatusToState(session.status) << session;
|
||||
|
||||
|
|
@ -314,15 +301,6 @@ void IosController::vpnStatusDidChange(void *pNotification)
|
|||
if (error != nil) {
|
||||
qDebug() << "Disconnect error" << error.domain << error.code << error.localizedDescription;
|
||||
|
||||
//MARK: Debug error
|
||||
if (error.userInfo) {
|
||||
qDebug() << " UserInfo:";
|
||||
for (NSString *key in error.userInfo.allKeys) {
|
||||
id value = error.userInfo[key];
|
||||
qDebug() << " " << key << ":" << value;
|
||||
}
|
||||
}
|
||||
/////
|
||||
if ([error.domain isEqualToString:NEVPNConnectionErrorDomain]) {
|
||||
switch (error.code) {
|
||||
case NEVPNConnectionErrorOverslept:
|
||||
|
|
@ -436,9 +414,6 @@ bool IosController::setupOpenVPN()
|
|||
openVPNConfig.insert(config_key::mtu, protocols::openvpn::defaultMtu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
openVPNConfig.insert(config_key::splitTunnelType, m_rawConfig[config_key::splitTunnelType]);
|
||||
|
||||
QJsonArray splitTunnelSites = m_rawConfig[config_key::splitTunnelSites].toArray();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue