summaryrefslogtreecommitdiff
path: root/src/de
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2014-01-01 17:48:13 +0100
committerArne Schwabe <arne@rfc2549.org>2014-01-01 17:48:13 +0100
commit68b6f8915630c8d68d3371092dced487447aea6b (patch)
tree80b67f14b4ccaf00df292b7a17afe11f10d2b4a4 /src/de
parent786f531907675739f6a3e068b5b123256ebd119b (diff)
Ignore certain status changes
Diffstat (limited to 'src/de')
-rw-r--r--src/de/blinkt/openvpn/core/OpenVpnManagementThread.java1
-rw-r--r--src/de/blinkt/openvpn/core/VpnStatus.java17
2 files changed, 15 insertions, 3 deletions
diff --git a/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java b/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java
index caec4bd7..cfc6776d 100644
--- a/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java
+++ b/src/de/blinkt/openvpn/core/OpenVpnManagementThread.java
@@ -339,6 +339,7 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement {
private void processState(String argument) {
String[] args = argument.split(",",3);
String currentstate = args[1];
+
if(args[2].equals(",,"))
VpnStatus.updateStateString(currentstate, "");
else
diff --git a/src/de/blinkt/openvpn/core/VpnStatus.java b/src/de/blinkt/openvpn/core/VpnStatus.java
index 20b56172..1a3a7a26 100644
--- a/src/de/blinkt/openvpn/core/VpnStatus.java
+++ b/src/de/blinkt/openvpn/core/VpnStatus.java
@@ -444,15 +444,26 @@ public class VpnStatus {
}
public synchronized static void updateStateString(String state, String msg, int resid, ConnectionStatus level) {
- mLaststate= state;
+ // Workound for OpenVPN doing AUTH and wait and being connected
+ // Simply ignore these state
+ if (mLastLevel == ConnectionStatus.LEVEL_CONNECTED &&
+ (state.equals("WAIT") || state.equals("AUTH")))
+ {
+ newLogItem(new LogItem((LogLevel.DEBUG), String.format("Ignoring OpenVPN Status in CONNECTED state (%s->%s): %s",state,level.toString(),msg)));
+ return;
+ }
+
+ mLaststate= state;
mLaststatemsg = msg;
mLastStateresid = resid;
mLastLevel = level;
- for (StateListener sl : stateListener) {
+
+
+ for (StateListener sl : stateListener) {
sl.updateState(state,msg,resid,level);
}
- newLogItem(new LogItem((LogLevel.DEBUG), String.format("New OpenVPN Status (%s->%s): %s",state,level.toString(),msg)));
+ //newLogItem(new LogItem((LogLevel.DEBUG), String.format("New OpenVPN Status (%s->%s): %s",state,level.toString(),msg)));
}
public static void logInfo(String message) {