mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 18:55:32 +00:00
aquatic_udp: move code only use in mio impl out of crate::common
This commit is contained in:
parent
81b7777a4a
commit
b10f7b89e7
16 changed files with 89 additions and 71 deletions
|
|
@ -12,13 +12,16 @@ use anyhow::Context;
|
|||
use crossbeam_channel::unbounded;
|
||||
use privdrop::PrivDrop;
|
||||
|
||||
pub mod common;
|
||||
pub mod handlers;
|
||||
pub mod network;
|
||||
pub mod tasks;
|
||||
|
||||
use crate::common::State;
|
||||
use aquatic_common::access_list::{AccessListArcSwap, AccessListMode, AccessListQuery};
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::update_access_list;
|
||||
|
||||
use common::State;
|
||||
|
||||
pub fn run(config: Config) -> ::anyhow::Result<()> {
|
||||
let state = State::default();
|
||||
|
|
@ -126,3 +129,14 @@ pub fn start_workers(
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn update_access_list(config: &Config, access_list: &Arc<AccessListArcSwap>) {
|
||||
match config.access_list.mode {
|
||||
AccessListMode::White | AccessListMode::Black => {
|
||||
if let Err(err) = access_list.update_from_path(&config.access_list.path) {
|
||||
::log::error!("Update access list from path: {:?}", err);
|
||||
}
|
||||
}
|
||||
AccessListMode::Off => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue