This commit is contained in:
Mateusz Gruszczyński committed 2026-10-08 09:42:10 +02:00
1 parent c24bc4279b
commit 3b3f0db377
84 files changed
+2686 -392

No files matched your search

+1 -1
View File
@@ -163,7 +163,7 @@ impl App {
active_streams,
stream_metrics,
cache,
geoip,
geoip: ArcSwap::from(geoip),
rate_limiter: Arc::new(crate::rate_limit::Limiter::new()),
acme: crate::acme::Manager::new(),
diagnostics,
+14
View File
@@ -53,6 +53,20 @@ mod cache_revision_tests {
transform_body_limit.transform.max_body_bytes += 1024;
assert_ne!(cache_revision(&transform_body_limit), identity);
let mut wire_only = base.clone();
wire_only.cache.bypass_query = !wire_only.cache.bypass_query;
wire_only.cache.bypass_prefixes.push("/private".into());
wire_only.cache.expose_status = !wire_only.cache.expose_status;
wire_only.cache.expose_hits = !wire_only.cache.expose_hits;
wire_only.cache.expose_cache_status = !wire_only.cache.expose_cache_status;
wire_only.cache.expose_resident_age = !wire_only.cache.expose_resident_age;
wire_only.cache.via_header = Some("RustProxy edge".into());
assert_eq!(cache_revision(&wire_only), identity);
assert!(matches!(
cache_invalidation(&base, &wire_only),
CacheInvalidation::None
));
let mut cache = base.clone();
cache.cache.max_entries += 1;
let cache_identity = cache_revision(&cache);
+11 -1
View File
@@ -42,7 +42,7 @@ pub struct App {
pub transform_metrics: Arc<crate::transform::Metrics>,
pub traffic: Arc<crate::traffic::Analytics>,
pub cache: Arc<crate::cache::Cache>,
pub geoip: Arc<crate::geoip::Database>,
pub geoip: ArcSwap<crate::geoip::Database>,
pub rate_limiter: Arc<crate::rate_limit::Limiter>,
pub acme: Arc<crate::acme::Manager>,
pub diagnostics: Arc<crate::diagnostics::Diagnostics>,
@@ -90,6 +90,16 @@ fn cache_revision(config: &config::Config) -> u64 {
let mut cache = config.cache.clone();
cache.memory_preset = None;
cache.cold_preset = None;
// Request bypass switches and response-only diagnostic headers do not alter
// already cached representations. Keep cache objects across these policy
// edits; the new behavior applies immediately on the next request.
cache.bypass_query = false;
cache.bypass_prefixes.clear();
cache.expose_status = false;
cache.expose_hits = false;
cache.expose_cache_status = false;
cache.expose_resident_age = false;
cache.via_header = None;
// Resource-only transform controls decide how much optimization work may
// happen concurrently, but do not change the transformed representation.
// Keep those out of the cache identity while including representation and
+7
View File
@@ -1,4 +1,11 @@
impl App {
pub fn start_geoip_updates(self: &Arc<Self>) {
self.tunnels.spawn(crate::geoip::update_poll_loop(
Arc::downgrade(self),
self.shutdown.clone(),
));
}
pub fn start_update_check(self: &Arc<Self>, config: crate::update_check::Config) {
self.software_update.configure(&config);
self.tunnels.spawn(crate::update_check::poll_loop(