diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index 1ed7bc39..1cfb2c27 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -378,13 +378,6 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac Connection connection = mProfile.mConnections[0]; VpnStatus.setCurrentlyConnectingProfile(mProfile); - // Set a flag that we are starting a new VPN - mStarting = true; - // Stop the previous session by interrupting the thread. - stopOldOpenVPNProcess(); - // An old running VPN should now be exited - mStarting = false; - // stop old running obfsvpn client if (!stopObfsvpn()) { VpnStatus.logError("Failed to stop already running obfsvpn client"); @@ -392,6 +385,13 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac return; } + // Set a flag that we are starting a new VPN + mStarting = true; + // Stop the previous session by interrupting the thread. + stopOldOpenVPNProcess(); + // An old running VPN should now be exited + mStarting = false; + // optionally start start obfsvpn and adapt openvpn config to the port obfsvpn is listening to Connection.TransportType transportType = connection.getTransportType(); if (mProfile.usePluggableTransports() && transportType.isPluggableTransport()) { |