mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
aquatic_udp: validate requests in socket workers
Also, don't send error responses for unconnected requests
This commit is contained in:
parent
fc90c71a56
commit
7616df9686
11 changed files with 88 additions and 259 deletions
|
|
@ -1,5 +1,4 @@
|
|||
use std::sync::atomic::Ordering;
|
||||
use std::time::Instant;
|
||||
|
||||
use histogram::Histogram;
|
||||
|
||||
|
|
@ -19,15 +18,6 @@ pub fn update_access_list(config: &Config, state: &State) {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn clean_connections(state: &State) {
|
||||
let now = Instant::now();
|
||||
|
||||
let mut connections = state.connections.lock();
|
||||
|
||||
connections.retain(|_, v| v.0 > now);
|
||||
connections.shrink_to_fit();
|
||||
}
|
||||
|
||||
pub fn gather_and_print_statistics(state: &State, config: &Config) {
|
||||
let interval = config.statistics.interval;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue