mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp: socket worker: only create access list cache once
This commit is contained in:
parent
deac3898ef
commit
d565c6e046
2 changed files with 4 additions and 4 deletions
1
TODO.md
1
TODO.md
|
|
@ -17,7 +17,6 @@
|
|||
* cargo-deny
|
||||
|
||||
* aquatic_udp
|
||||
* don't constantly recreate access list cache
|
||||
* request worker: use `ValidUntil::new_with_now`
|
||||
* look at proper cpu pinning (check that one thread gets bound per core)
|
||||
* then consider so_attach_reuseport_cbpf
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ pub fn run_socket_worker(
|
|||
let mut events = Events::with_capacity(config.network.poll_event_capacity);
|
||||
let mut connections = ConnectionMap::default();
|
||||
let mut pending_scrape_responses = PendingScrapeResponseMap::default();
|
||||
let mut access_list_cache = create_access_list_cache(&state.access_list);
|
||||
|
||||
let mut local_responses: Vec<(Response, SocketAddr)> = Vec::new();
|
||||
|
||||
|
|
@ -166,6 +167,7 @@ pub fn run_socket_worker(
|
|||
&state,
|
||||
&mut connections,
|
||||
&mut pending_scrape_responses,
|
||||
&mut access_list_cache,
|
||||
&mut rng,
|
||||
&mut socket,
|
||||
&mut buffer,
|
||||
|
|
@ -218,6 +220,7 @@ fn read_requests(
|
|||
state: &State,
|
||||
connections: &mut ConnectionMap,
|
||||
pending_scrape_responses: &mut PendingScrapeResponseMap,
|
||||
access_list_cache: &mut AccessListCache,
|
||||
rng: &mut StdRng,
|
||||
socket: &mut UdpSocket,
|
||||
buffer: &mut [u8],
|
||||
|
|
@ -231,8 +234,6 @@ fn read_requests(
|
|||
let mut bytes_received_ipv4: usize = 0;
|
||||
let mut bytes_received_ipv6 = 0;
|
||||
|
||||
let mut access_list_cache = create_access_list_cache(&state.access_list);
|
||||
|
||||
loop {
|
||||
match socket.recv_from(&mut buffer[..]) {
|
||||
Ok((amt, src)) => {
|
||||
|
|
@ -272,7 +273,7 @@ fn read_requests(
|
|||
config,
|
||||
connections,
|
||||
pending_scrape_responses,
|
||||
&mut access_list_cache,
|
||||
access_list_cache,
|
||||
rng,
|
||||
request_sender,
|
||||
local_responses,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue