summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/OpenVpnManagementThread.java
diff options
context:
space:
mode:
authorarne <arne@gaia.fritz.box>2012-12-25 23:22:13 +0100
committerarne <arne@gaia.fritz.box>2012-12-25 23:22:13 +0100
commitc9dc454f4ec38f075f951fbf32935054023eed94 (patch)
tree33d36c8bfb68db406e3ae90237b145077efecda5 /src/de/blinkt/openvpn/OpenVpnManagementThread.java
parente57c7dd4a792d02897140d0c5e2d014bcd1147c0 (diff)
parentb2b8b3da3f501543338fc5065519ab778379c274 (diff)
Merge local changes with repository
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVpnManagementThread.java')
-rw-r--r--src/de/blinkt/openvpn/OpenVpnManagementThread.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/de/blinkt/openvpn/OpenVpnManagementThread.java b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
index 24537732..4e26c44b 100644
--- a/src/de/blinkt/openvpn/OpenVpnManagementThread.java
+++ b/src/de/blinkt/openvpn/OpenVpnManagementThread.java
@@ -39,7 +39,8 @@ public class OpenVpnManagementThread implements Runnable {
private long mLastOut=0;
private LocalServerSocket mServerSocket;
private boolean mReleaseHold=true;
- private boolean mWaitingForRelease=false;
+ private boolean mWaitingForRelease=false;
+ private long mLastHoldRelease=0;
private static Vector<OpenVpnManagementThread> active=new Vector<OpenVpnManagementThread>();
@@ -223,18 +224,24 @@ public class OpenVpnManagementThread implements Runnable {
}
}
private void releaseHoldCmd() {
+ if ((System.currentTimeMillis()- mLastHoldRelease) < 5000) {
+ try {
+ Thread.sleep(3000);
+ } catch (InterruptedException e) {}
+
+ }
mWaitingForRelease=false;
- mReleaseHold=true;
+ mLastHoldRelease = System.currentTimeMillis();
managmentCommand("hold release\n");
managmentCommand("bytecount " + mBytecountinterval + "\n");
managmentCommand("state on\n");
}
public void releaseHold() {
+ mReleaseHold=true;
if(mWaitingForRelease)
releaseHoldCmd();
- else
- mReleaseHold=true;
+
}
private void processProxyCMD(String argument) {
@@ -459,9 +466,9 @@ public class OpenVpnManagementThread implements Runnable {
}
public void signalusr1() {
+ mReleaseHold=false;
if(!mWaitingForRelease)
managmentCommand("signal SIGUSR1\n");
- mReleaseHold=false;
}
public void reconnect() {
@@ -473,11 +480,12 @@ public class OpenVpnManagementThread implements Runnable {
PrivateKey privkey = mProfile.getKeystoreKey();
Exception err =null;
- // The Jelly Bean *evil* Hack
byte[] data = Base64.decode(b64data, Base64.DEFAULT);
- if(Build.VERSION.SDK_INT>=16){
+ // The Jelly Bean *evil* Hack
+ // 4.2 implements the RSA/ECB/PKCS1PADDING in the OpenSSLprovider
+ if(Build.VERSION.SDK_INT==16){
processSignJellyBeans(privkey,data);
return;
}