mirror of
https://github.com/telemt/telemt.git
synced 2026-10-07 18:05:57 +03:00
Split oversized runtime modules + Async tests hardened
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
@@ -98,7 +98,9 @@ pub(super) fn auth_probe_is_throttled_in(
|
||||
};
|
||||
if auth_probe_state_expired(&entry, now) {
|
||||
drop(entry);
|
||||
state.remove_if(&peer_ip, |_, current| auth_probe_state_expired(current, now));
|
||||
state.remove_if(&peer_ip, |_, current| {
|
||||
auth_probe_state_expired(current, now)
|
||||
});
|
||||
return false;
|
||||
}
|
||||
now < entry.blocked_until
|
||||
@@ -116,7 +118,9 @@ pub(super) fn auth_probe_saturation_grace_exhausted_in(
|
||||
};
|
||||
if auth_probe_state_expired(&entry, now) {
|
||||
drop(entry);
|
||||
state.remove_if(&peer_ip, |_, current| auth_probe_state_expired(current, now));
|
||||
state.remove_if(&peer_ip, |_, current| {
|
||||
auth_probe_state_expired(current, now)
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -264,7 +268,8 @@ pub(super) fn auth_probe_record_failure_with_state_in(
|
||||
}
|
||||
}
|
||||
|
||||
let Some((evict_key, evict_fail_streak, evict_last_seen)) = eviction_candidate else {
|
||||
let Some((evict_key, evict_fail_streak, evict_last_seen)) = eviction_candidate
|
||||
else {
|
||||
return;
|
||||
};
|
||||
if state
|
||||
|
||||
@@ -266,8 +266,7 @@ where
|
||||
return HandshakeResult::BadClient { reader, writer };
|
||||
}
|
||||
|
||||
let selected_tls_domain =
|
||||
matched_tls_domain.unwrap_or(config.censorship.tls_domain.as_str());
|
||||
let selected_tls_domain = matched_tls_domain.unwrap_or(config.censorship.tls_domain.as_str());
|
||||
let cached_entry = if config.censorship.tls_emulation {
|
||||
if let Some(cache) = tls_cache.as_ref() {
|
||||
let cached_entry = cache.get(selected_tls_domain).await;
|
||||
|
||||
Reference in New Issue
Block a user