aquatic_http access list: add config, state field, initial load

This commit is contained in:
Joakim Frostegård 2021-10-15 22:38:58 +02:00
parent b8b9a9839a
commit 4fa199a1e0
3 changed files with 18 additions and 0 deletions

View file

@ -1,6 +1,7 @@
use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr};
use std::sync::Arc;
use aquatic_common::access_list::AccessList;
use crossbeam_channel::{Receiver, Sender};
use either::Either;
use hashbrown::HashMap;
@ -116,12 +117,14 @@ pub struct TorrentMaps {
#[derive(Clone)]
pub struct State {
pub torrent_maps: Arc<Mutex<TorrentMaps>>,
pub access_list: Arc<Mutex<AccessList>>,
}
impl Default for State {
fn default() -> Self {
Self {
torrent_maps: Arc::new(Mutex::new(TorrentMaps::default())),
access_list: Arc::new(Mutex::new(AccessList::default())),
}
}
}