diff options
author | Arne Schwabe <arne@rfc2549.org> | 2014-02-18 22:28:49 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2014-02-18 22:28:49 +0100 |
commit | 1b9a8b81428a8d9fc20da93d0e01c8bf8f674a03 (patch) | |
tree | 78fd7b15647bc1d39675a823aa9dd718fac9f318 | |
parent | c5ed8dea40bdcd3ca89093227ac43f60d1e333a8 (diff) |
Fix not using low priority on CONNECTED state
-rw-r--r-- | main/openvpn/src/openvpn/route.c | 7 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java | 2 | ||||
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java | 8 |
3 files changed, 14 insertions, 3 deletions
diff --git a/main/openvpn/src/openvpn/route.c b/main/openvpn/src/openvpn/route.c index 545a929b..e4224e19 100644 --- a/main/openvpn/src/openvpn/route.c +++ b/main/openvpn/src/openvpn/route.c @@ -109,6 +109,13 @@ new_route_ipv6_option_list (struct gc_arena *a) return ret; } +/* + * NOTE: structs are cloned/copied shallow by design. + * The routes list from src will stay intact since it is allocated using + * the options->gc. The cloned/copied lists will share this common tail + * to avoid copying the data around between pulls. Pulled routes use + * the c2->gc so they get freed immediately after a reconnect. + */ struct route_option_list * clone_route_option_list (const struct route_option_list *src, struct gc_arena *a) { diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java index 08d28ca1..1937ffc0 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnManagementThread.java @@ -429,7 +429,7 @@ public class OpenVpnManagementThread implements Runnable, OpenVPNManagement { return false;
}
- ParcelFileDescriptor pfd = mOpenVPNService.openTun();
+ ParcelFileDescriptor pfd = mOpenVPNService.openTun();
if(pfd==null)
return false;
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java index 1e9e14f1..0de791d6 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVpnService.java @@ -638,6 +638,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac if (mProcessThread == null && !mNotificationAlwaysVisible) return; + boolean lowpriority = false; // Display byte count only after being connected { @@ -648,6 +649,7 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac } else if (level == LEVEL_CONNECTED) { mDisplayBytecount = true; mConnecttime = System.currentTimeMillis(); + lowpriority = true; } else { mDisplayBytecount = false; } @@ -655,8 +657,10 @@ public class OpenVpnService extends VpnService implements StateListener, Callbac // Other notifications are shown, // This also mean we are no longer connected, ignore bytecount messages until next // CONNECTED - String ticker = getString(resid); - showNotification(getString(resid) + " " + logmessage, ticker, false, 0, level); + // Does not work :( + String msg = getString(resid); + String ticker = msg; + showNotification(msg + " " + logmessage, ticker, lowpriority , 0, level); } } |