diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-12-18 11:25:45 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-12-18 11:25:45 +0100 |
commit | 84f5af0d99dc208468e29c2c423591b75a060795 (patch) | |
tree | 42772f389dfc83072a4a53b594f12fbc59e89f60 /src | |
parent | 9fe3b7ce6d350474d0827cb6ff6554eafa822378 (diff) |
Fix the Illegal Thread State bug
Diffstat (limited to 'src')
-rw-r--r-- | src/de/blinkt/openvpn/ConfigConverter.java | 2 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/OpenVPNThread.java | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/de/blinkt/openvpn/ConfigConverter.java b/src/de/blinkt/openvpn/ConfigConverter.java index 8d746409..393384b8 100644 --- a/src/de/blinkt/openvpn/ConfigConverter.java +++ b/src/de/blinkt/openvpn/ConfigConverter.java @@ -228,7 +228,7 @@ public class ConfigConverter extends ListActivity { File possibleFile = findFile(filename); if(possibleFile==null) - return null; + return filename; else return readFileContent(possibleFile,base64encode); diff --git a/src/de/blinkt/openvpn/OpenVPNThread.java b/src/de/blinkt/openvpn/OpenVPNThread.java index b4ead269..13b8688b 100644 --- a/src/de/blinkt/openvpn/OpenVPNThread.java +++ b/src/de/blinkt/openvpn/OpenVPNThread.java @@ -39,9 +39,11 @@ public class OpenVPNThread implements Runnable { } finally {
int exitvalue = 0;
try {
- exitvalue = mProcess.exitValue();
+ exitvalue = mProcess.waitFor();
} catch ( IllegalThreadStateException ite) {
OpenVPN.logError("Illegal Thread state: " + ite.getLocalizedMessage());
+ } catch (InterruptedException ie) {
+ OpenVPN.logError("InterruptedException: " + ie.getLocalizedMessage());
}
if( exitvalue != 0)
OpenVPN.logError("Process exited with exit value " + exitvalue);
@@ -84,12 +86,12 @@ public class OpenVPNThread implements Runnable { mProcess.getOutputStream().close();
InputStream in = mProcess.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
-
-
+
while(true) {
String logline = br.readLine();
- if(logline==null)
+ if(logline==null) {
return;
+ }
OpenVPN.logMessage(0, "P:", logline);
}
|