summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVpnManagementThread.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-09 17:57:40 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-09 17:57:40 +0200
commitbebf2a9428e369a4963956ec752db27c457d9f6b (patch)
treea46475895895944a79b3452a1805ae31a7f40f4e /src/de/blinkt/openvpn/OpenVpnManagementThread.java
parent224be050299691f2ca35d79f69aaf39d92fdbeaa (diff)
Only try to write minivpn once per program lifetime.
Remove debug logging
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVpnManagementThread.java')
-rw-r--r--src/de/blinkt/openvpn/OpenVpnManagementThread.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnManagementThread.java b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
index 18d543f1..bc2b0e13 100644
--- a/src/de/blinkt/openvpn/OpenVpnManagementThread.java
+++ b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
@@ -33,7 +33,7 @@ public class OpenVpnManagementThread implements Runnable {
}
public void managmentCommand(String cmd) {
- Log.d("openvpn", "mgmt cmd" + mSocket + " " +cmd + " " );
+ //Log.d("openvpn", "mgmt cmd" + mSocket + " " +cmd + " " );
try {
mSocket.getOutputStream().write(cmd.getBytes());
mSocket.getOutputStream().flush();
@@ -144,21 +144,24 @@ public class OpenVpnManagementThread implements Runnable {
String argument = parts[1];
- if(cmd.equals("INFO"))
- logStatusMessage(command);
- else if (cmd.equals("PASSWORD")) {
+ if(cmd.equals("INFO")) {
+ // Ignore greeting from mgmt
+ //logStatusMessage(command);
+ }else if (cmd.equals("PASSWORD")) {
processPWCommand(argument);
} else if (cmd.equals("HOLD")) {
managmentCommand("hold release\n");
- managmentCommand("log on\n");
- managmentCommand("bytecount 13\n");
+ //managmentCommand("log on\n");
} else if (cmd.equals("NEED-OK")) {
processNeedCommand(argument);
} else if (cmd.equals("LOG")) {
- OpenVPN.logMessage(0, "", command);
+ String[] args = argument.split(",",3);
+ // 0 unix time stamp
+ // 1 log level N,I,E etc.
+ // 2 log message
+ OpenVPN.logMessage(0, "", args[2]);
} else {
OpenVPN.logMessage(0, "MGMT:", "Got unrecognized command" + command);
- managmentCommand("log 1\n");
Log.i(TAG, "Got unrecognized command" + command);
}
} else if (command.startsWith("SUCCESS:")) {