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
|
* cargo-deny
|
||||||
|
|
||||||
* aquatic_udp
|
* aquatic_udp
|
||||||
* don't constantly recreate access list cache
|
|
||||||
* request worker: use `ValidUntil::new_with_now`
|
* request worker: use `ValidUntil::new_with_now`
|
||||||
* look at proper cpu pinning (check that one thread gets bound per core)
|
* look at proper cpu pinning (check that one thread gets bound per core)
|
||||||
* then consider so_attach_reuseport_cbpf
|
* 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 events = Events::with_capacity(config.network.poll_event_capacity);
|
||||||
let mut connections = ConnectionMap::default();
|
let mut connections = ConnectionMap::default();
|
||||||
let mut pending_scrape_responses = PendingScrapeResponseMap::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();
|
let mut local_responses: Vec<(Response, SocketAddr)> = Vec::new();
|
||||||
|
|
||||||
|
|
@ -166,6 +167,7 @@ pub fn run_socket_worker(
|
||||||
&state,
|
&state,
|
||||||
&mut connections,
|
&mut connections,
|
||||||
&mut pending_scrape_responses,
|
&mut pending_scrape_responses,
|
||||||
|
&mut access_list_cache,
|
||||||
&mut rng,
|
&mut rng,
|
||||||
&mut socket,
|
&mut socket,
|
||||||
&mut buffer,
|
&mut buffer,
|
||||||
|
|
@ -218,6 +220,7 @@ fn read_requests(
|
||||||
state: &State,
|
state: &State,
|
||||||
connections: &mut ConnectionMap,
|
connections: &mut ConnectionMap,
|
||||||
pending_scrape_responses: &mut PendingScrapeResponseMap,
|
pending_scrape_responses: &mut PendingScrapeResponseMap,
|
||||||
|
access_list_cache: &mut AccessListCache,
|
||||||
rng: &mut StdRng,
|
rng: &mut StdRng,
|
||||||
socket: &mut UdpSocket,
|
socket: &mut UdpSocket,
|
||||||
buffer: &mut [u8],
|
buffer: &mut [u8],
|
||||||
|
|
@ -231,8 +234,6 @@ fn read_requests(
|
||||||
let mut bytes_received_ipv4: usize = 0;
|
let mut bytes_received_ipv4: usize = 0;
|
||||||
let mut bytes_received_ipv6 = 0;
|
let mut bytes_received_ipv6 = 0;
|
||||||
|
|
||||||
let mut access_list_cache = create_access_list_cache(&state.access_list);
|
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
match socket.recv_from(&mut buffer[..]) {
|
match socket.recv_from(&mut buffer[..]) {
|
||||||
Ok((amt, src)) => {
|
Ok((amt, src)) => {
|
||||||
|
|
@ -272,7 +273,7 @@ fn read_requests(
|
||||||
config,
|
config,
|
||||||
connections,
|
connections,
|
||||||
pending_scrape_responses,
|
pending_scrape_responses,
|
||||||
&mut access_list_cache,
|
access_list_cache,
|
||||||
rng,
|
rng,
|
||||||
request_sender,
|
request_sender,
|
||||||
local_responses,
|
local_responses,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue