summaryrefslogtreecommitdiff
path: root/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
diff options
context:
space:
mode:
authorAlex Semenov <asemenovboyarka@gmail.com>2016-11-08 22:05:29 +0200
committerArne Schwabe <arne@rfc2549.org>2016-11-08 21:05:29 +0100
commitb92a1252b395bc875a311eb4e7b4558b7e625483 (patch)
treef19b6f60024073424dc8cf75c573843a0ebbe8c7 /main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
parentdf2f911a6e10503bee9e99f61f7c19e6e34148a8 (diff)
Vpn stop management issues (#572)
* Fixed error, when stopVPN method in ManagementThread returned true regardless of actual stop signal have been sent. As result - management stopped to send any state updates to listeners because of mShuttingDown flag. * Fixed error, when endVpnService method didn't actually stop vpn thread because of missing thread interruption handling.
Diffstat (limited to 'main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
index 59bcca37..b2774861 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
@@ -180,10 +180,12 @@ public class OpenVPNThread implements Runnable {
} else {
VpnStatus.logInfo("P:" + logline);
}
- }
-
- } catch (IOException e) {
+ if (Thread.interrupted()) {
+ throw new InterruptedException("OpenVpn process was killed form java code");
+ }
+ }
+ } catch (InterruptedException | IOException e) {
VpnStatus.logException("Error reading from output of OpenVPN process", e);
stopProcess();
}