summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVpnManagementThread.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-01 00:26:54 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-01 00:26:54 +0200
commitf26bdab76d0632aa0f1489c58e9ccc28bf1c74ba (patch)
tree436cd91b85b5f1f704ea22e041c8d12dfb51ed8f /src/de/blinkt/openvpn/OpenVpnManagementThread.java
parent529dec2494c87181899d3479c5d631f5a84f715e (diff)
The real 0.4.6 version as being pushed to the market.
adds working clear and disconnect buttons to log window
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVpnManagementThread.java')
-rw-r--r--src/de/blinkt/openvpn/OpenVpnManagementThread.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnManagementThread.java b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
index 00d8fe9b..02e5dc46 100644
--- a/src/de/blinkt/openvpn/OpenVpnManagementThread.java
+++ b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
@@ -2,6 +2,7 @@ package de.blinkt.openvpn;
import java.io.IOException;
import java.io.InputStream;
+import java.util.Vector;
import android.net.LocalSocket;
import android.util.Log;
@@ -11,7 +12,8 @@ public class OpenVpnManagementThread implements Runnable {
private static final String TAG = "openvpn";
private LocalSocket mSocket;
private VpnProfile mProfile;
-
+private static Vector<OpenVpnManagementThread> active=new Vector<OpenVpnManagementThread>();
+
public OpenVpnManagementThread(VpnProfile profile, LocalSocket mgmtsocket) {
mProfile = profile;
mSocket = mgmtsocket;
@@ -48,6 +50,7 @@ public class OpenVpnManagementThread implements Runnable {
e.printStackTrace();
}
String pendingInput="";
+ active.add(this);
try {
@@ -68,6 +71,7 @@ public class OpenVpnManagementThread implements Runnable {
} catch (IOException e) {
e.printStackTrace();
}
+ active.remove(this);
}
@@ -133,8 +137,14 @@ public class OpenVpnManagementThread implements Runnable {
private void logStatusMessage(String command) {
- // TODO Auto-generated method stub
-
+ OpenVPN.logMessage(0,"MGMT:", command);
+ }
+
+
+ public static void stopOpenVPN() {
+ for (OpenVpnManagementThread mt: active){
+ mt.managmentCommand("signal SIGINT\n");
+ }
}
}