Prioritize Android VPN TCP handshakes
This commit is contained in:
@@ -30,8 +30,8 @@ android {
|
|||||||
applicationId "su.cin.rapvpn"
|
applicationId "su.cin.rapvpn"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 35
|
targetSdk 35
|
||||||
versionCode 199
|
versionCode 200
|
||||||
versionName "0.2.199"
|
versionName "0.2.200"
|
||||||
buildConfigField "String", "DEFAULT_BACKEND_URL", "\"${normalizeGradleString(defaultBackendUrl)}\""
|
buildConfigField "String", "DEFAULT_BACKEND_URL", "\"${normalizeGradleString(defaultBackendUrl)}\""
|
||||||
buildConfigField "String", "DEFAULT_CLUSTER_ID", "\"${normalizeGradleString(defaultClusterId)}\""
|
buildConfigField "String", "DEFAULT_CLUSTER_ID", "\"${normalizeGradleString(defaultClusterId)}\""
|
||||||
buildConfigField "String", "DEFAULT_ORGANIZATION_ID", "\"${normalizeGradleString(defaultOrganizationId)}\""
|
buildConfigField "String", "DEFAULT_ORGANIZATION_ID", "\"${normalizeGradleString(defaultOrganizationId)}\""
|
||||||
|
|||||||
@@ -2267,7 +2267,14 @@ public class RapVpnService extends VpnService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTCPPriorityPacket(byte[] packet, int length) {
|
private boolean isTCPPriorityPacket(byte[] packet, int length) {
|
||||||
return false;
|
TCPFlow flow = tcpFlow(packet, length);
|
||||||
|
if (flow == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
boolean syn = (flow.flags & 0x02) != 0;
|
||||||
|
boolean fin = (flow.flags & 0x01) != 0;
|
||||||
|
boolean rst = (flow.flags & 0x04) != 0;
|
||||||
|
return syn || fin || rst;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean clampIPv4TCPMSS(byte[] packet, int length, int maxMss) {
|
private boolean clampIPv4TCPMSS(byte[] packet, int length, int maxMss) {
|
||||||
@@ -3532,6 +3539,8 @@ public class RapVpnService extends VpnService {
|
|||||||
|| "source_drop".equals(state)
|
|| "source_drop".equals(state)
|
||||||
|| "normalize_drop".equals(state)
|
|| "normalize_drop".equals(state)
|
||||||
|| "length_drop".equals(state)
|
|| "length_drop".equals(state)
|
||||||
|
|| "tcp_syn_ack".equals(state)
|
||||||
|
|| "tcp_mss_clamp".equals(state)
|
||||||
|| ("downlink".equals(prefix) && !"batch".equals(state) && !"restart".equals(state) && !"running".equals(state))
|
|| ("downlink".equals(prefix) && !"batch".equals(state) && !"restart".equals(state) && !"running".equals(state))
|
||||||
|| ("downlink_writer".equals(prefix) && !"write".equals(state) && !"writer_idle".equals(state));
|
|| ("downlink_writer".equals(prefix) && !"write".equals(state) && !"writer_idle".equals(state));
|
||||||
if (!important && now - lastRuntimeDetailAt < RUNTIME_DETAIL_INTERVAL_MS) {
|
if (!important && now - lastRuntimeDetailAt < RUNTIME_DETAIL_INTERVAL_MS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user