mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
access lists: filter requests in socket workers instead
This commit is contained in:
parent
33966bed57
commit
7ccd5fcbf7
18 changed files with 221 additions and 163 deletions
|
|
@ -23,7 +23,7 @@ pub const APP_NAME: &str = "aquatic_udp: UDP BitTorrent tracker";
|
|||
pub fn run(config: Config) -> ::anyhow::Result<()> {
|
||||
let state = State::default();
|
||||
|
||||
tasks::update_access_list(&config, &mut state.torrents.lock());
|
||||
tasks::update_access_list(&config, &state);
|
||||
|
||||
let num_bound_sockets = start_workers(config.clone(), state.clone())?;
|
||||
|
||||
|
|
@ -56,12 +56,9 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
|
|||
::std::thread::sleep(Duration::from_secs(config.cleaning.interval));
|
||||
|
||||
tasks::clean_connections(&state);
|
||||
tasks::update_access_list(&config, &state);
|
||||
|
||||
let mut torrent_maps = state.torrents.lock();
|
||||
|
||||
tasks::update_access_list(&config, &mut torrent_maps);
|
||||
|
||||
torrent_maps.clean(&config);
|
||||
state.torrents.lock().clean(&config, &state.access_list);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue