feat: ping-and-exit for server RTT, remove broken UDP ping
- Ping button: pings all servers via native QUIC, saves RTT + fingerprint to SharedPreferences, then exits process (System.exit) - On restart: loads saved ping results (no native .so loading needed) - Avoids jemalloc crash: native lib only loaded once per process lifetime - Removed broken UDP probe (QUIC servers don't respond to it) - SettingsRepository: savePingRtt/loadPingRtt for cached results - PingResult: added reachable field Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -185,4 +185,14 @@ class SettingsRepository(context: Context) {
|
||||
fun loadServerFingerprint(address: String): String? {
|
||||
return prefs.getString("$TOFU_PREFIX$address", null)
|
||||
}
|
||||
|
||||
// --- Ping RTT cache ---
|
||||
|
||||
fun savePingRtt(address: String, rttMs: Int) {
|
||||
prefs.edit().putInt("ping_rtt_$address", rttMs).apply()
|
||||
}
|
||||
|
||||
fun loadPingRtt(address: String): Int {
|
||||
return prefs.getInt("ping_rtt_$address", -1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user