summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2016-03-09 13:15:50 +0100
committerArne Schwabe <arne@rfc2549.org>2016-03-09 13:15:50 +0100
commit89b6473abbd3fad859e8a2e0ca1733a6cd8d5805 (patch)
tree205d193fc12d4761dd130d7646ccbc1e9463a8e6 /main
parent752e5bf1c80e63cbb9a8fa81d0213097c97d422b (diff)
Bug not yet understand but try to the best to avoid it being triggered
Diffstat (limited to 'main')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java8
-rwxr-xr-xmain/src/main/res/values/strings.xml1
2 files changed, 8 insertions, 1 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java
index da9cb6ef..9f63785c 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/LogFileHandler.java
@@ -20,6 +20,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Locale;
+import de.blinkt.openvpn.R;
import de.blinkt.openvpn.fragments.Utils;
/**
@@ -45,6 +46,8 @@ class LogFileHandler extends Handler {
public void handleMessage(Message msg) {
try {
if (msg.what == LOG_INIT) {
+ if (mLogFile != null)
+ throw new RuntimeException("mLogFile not null");
readLogCache((File) msg.obj);
openLogFile((File) msg.obj);
} else if (msg.what == LOG_MESSAGE && msg.obj instanceof VpnStatus.LogItem) {
@@ -109,7 +112,6 @@ class LogFileHandler extends Handler {
if (!logfile.exists() || !logfile.canRead())
return;
- VpnStatus.logDebug("Reread log items from cache file");
try {
@@ -146,7 +148,11 @@ class LogFileHandler extends Handler {
VpnStatus.logError("Too many logentries read from cache, aborting.");
read = 0;
}
+
}
+ VpnStatus.logDebug(R.string.reread_log, itemsRead);
+
+
} catch (java.io.IOException | java.lang.RuntimeException e) {
VpnStatus.logError("Reading cached logfile failed");
diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml
index ec3449eb..85bf1128 100755
--- a/main/src/main/res/values/strings.xml
+++ b/main/src/main/res/values/strings.xml
@@ -404,4 +404,5 @@
<string name="missing_certificates">Missing user certificate or user certifcate key file</string>
<string name="missing_ca_certificate">Missing CA certificate</string>
<string name="crl_title">Certifcate Revoke List (optional)</string>
+ <string name="reread_log">Reread (%d) log items from log cache file</string>
</resources>