diff options
author | Parménides GV <parmegv@sdf.org> | 2013-11-07 21:26:07 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-11-07 21:26:07 +0100 |
commit | 6ff02fbc614756991220dacf910dc447a4046f06 (patch) | |
tree | e6188b2f7526d519fbaa40bbedbd99f94b9df8f0 /src/se/leap/openvpn/OpenVpnManagementThread.java | |
parent | dd7c9914165dd85f2eff0ad3872995c83678cfcb (diff) |
Special debug log: "OpenVPN log" tag
The log shows all state commands, and notifies when bytecount values have not changed more than 3 times in a row.
Diffstat (limited to 'src/se/leap/openvpn/OpenVpnManagementThread.java')
-rw-r--r-- | src/se/leap/openvpn/OpenVpnManagementThread.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/se/leap/openvpn/OpenVpnManagementThread.java b/src/se/leap/openvpn/OpenVpnManagementThread.java index 6ab86056..2445c38e 100644 --- a/src/se/leap/openvpn/OpenVpnManagementThread.java +++ b/src/se/leap/openvpn/OpenVpnManagementThread.java @@ -182,7 +182,6 @@ public class OpenVpnManagementThread implements Runnable { String cmd = parts[0].substring(1);
String argument = parts[1];
- Log.d("OpenVPN log", command);
if(cmd.equals("INFO")) {
// Ignore greeting from mgmt
//logStatusMessage(command);
@@ -273,13 +272,14 @@ public class OpenVpnManagementThread implements Runnable { private void processState(String argument) {
String[] args = argument.split(",",3);
String currentstate = args[1];
+ Log.d("OpenVPN log", argument);
if(args[2].equals(",,"))
OpenVPN.updateStateString(currentstate,"");
else
OpenVPN.updateStateString(currentstate,args[2]);
}
-
+ private static int repeated_byte_counts = 0;
private void processByteCount(String argument) {
// >BYTECOUNT:{BYTES_IN},{BYTES_OUT}
int comma = argument.indexOf(',');
@@ -288,7 +288,10 @@ public class OpenVpnManagementThread implements Runnable { long diffin = in - mLastIn;
long diffout = out - mLastOut;
-
+ if(diffin == 0 && diffout == 0)
+ repeated_byte_counts++;
+ if(repeated_byte_counts > 3)
+ Log.d("OpenVPN log", "Repeated byte count = " + repeated_byte_counts);
mLastIn=in;
mLastOut=out;
|