diff --git a/src/main.rs b/src/main.rs index 34710ae..1092d4a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,15 +14,15 @@ use numa::ctx::{handle_query, ServerCtx}; use numa::forward::Upstream; use numa::override_store::OverrideStore; use numa::query_log::QueryLog; - -const QUAD9_IP: &str = "9.9.9.9"; -const DOH_FALLBACK: &str = "https://9.9.9.9/dns-query"; use numa::service_store::ServiceStore; use numa::stats::ServerStats; use numa::system_dns::{ discover_system_dns, install_service, restart_service, service_status, uninstall_service, }; +const QUAD9_IP: &str = "9.9.9.9"; +const DOH_FALLBACK: &str = "https://9.9.9.9/dns-query"; + #[tokio::main] async fn main() -> numa::Result<()> { env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")) diff --git a/src/srtt.rs b/src/srtt.rs index fb0d36f..f763a37 100644 --- a/src/srtt.rs +++ b/src/srtt.rs @@ -119,11 +119,6 @@ impl SrttCache { self.entries.is_empty() } - #[cfg(test)] - fn get_srtt_ms(&self, ip: IpAddr) -> u64 { - self.entries.get(&ip).map(|e| e.srtt_ms).unwrap_or(0) - } - fn maybe_evict(&mut self) { if self.entries.len() < MAX_ENTRIES { return; @@ -219,15 +214,6 @@ mod tests { assert_eq!(addrs, original); } - /// Cache with ip(1) saturated at FAILURE_PENALTY_MS - fn saturated_penalty_cache() -> SrttCache { - let mut cache = SrttCache::new(true); - for _ in 0..30 { - cache.record_rtt(ip(1), FAILURE_PENALTY_MS, false); - } - cache - } - #[test] fn no_decay_within_threshold() { // At exactly DECAY_AFTER_SECS, no decay applied