From 2c56a8ea9582bca5de98b71ee83252ee99f2a92e Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Tue, 9 Jul 2019 12:39:54 +0200 Subject: [PATCH] Send PUSH_REQUEST immediately after auth First call would always fail otherwise. --- .../Sources/Protocols/OpenVPN/CoreConfiguration+OpenVPN.swift | 2 -- TunnelKit/Sources/Protocols/OpenVPN/OpenVPNSession.swift | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/TunnelKit/Sources/Protocols/OpenVPN/CoreConfiguration+OpenVPN.swift b/TunnelKit/Sources/Protocols/OpenVPN/CoreConfiguration+OpenVPN.swift index 0e31a98..4a8e35d 100644 --- a/TunnelKit/Sources/Protocols/OpenVPN/CoreConfiguration+OpenVPN.swift +++ b/TunnelKit/Sources/Protocols/OpenVPN/CoreConfiguration+OpenVPN.swift @@ -57,8 +57,6 @@ extension CoreConfiguration { static let retransmissionLimit = 0.1 - static let softResetDelay = 5.0 - static let softNegotiationTimeout = 120.0 // MARK: Authentication diff --git a/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNSession.swift b/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNSession.swift index 24350be..b7e763d 100644 --- a/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNSession.swift +++ b/TunnelKit/Sources/Protocols/OpenVPN/OpenVPNSession.swift @@ -871,8 +871,9 @@ public class OpenVPNSession: Session { } negotiationKey.controlState = .preIfConfig - nextPushRequestDate = Date().addingTimeInterval(isRenegotiating ? CoreConfiguration.OpenVPN.softResetDelay : CoreConfiguration.OpenVPN.retransmissionLimit) + nextPushRequestDate = Date() pushRequest() + nextPushRequestDate?.addTimeInterval(isRenegotiating ? CoreConfiguration.OpenVPN.pushRequestInterval : CoreConfiguration.OpenVPN.retransmissionLimit) } for message in auth.parseMessages() {