mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_udp: update access list at startup, exit on failure
This commit is contained in:
parent
f370dac330
commit
9893341622
2 changed files with 8 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ use std::thread::Builder;
|
|||
use std::time::Duration;
|
||||
|
||||
use anyhow::Context;
|
||||
use aquatic_common::AccessListType;
|
||||
use crossbeam_channel::unbounded;
|
||||
use privdrop::PrivDrop;
|
||||
|
||||
|
|
@ -23,6 +24,13 @@ pub const APP_NAME: &str = "aquatic_udp: UDP BitTorrent tracker";
|
|||
pub fn run(config: Config) -> ::anyhow::Result<()> {
|
||||
let state = State::default();
|
||||
|
||||
match config.access_list.list_type {
|
||||
AccessListType::Allow | AccessListType::Deny => {
|
||||
state.access_list.lock().update_from_path(&config.access_list.path)?;
|
||||
},
|
||||
AccessListType::Ignore => {},
|
||||
}
|
||||
|
||||
let num_bound_sockets = start_workers(config.clone(), state.clone())?;
|
||||
|
||||
if config.privileges.drop_privileges {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue