Update dependencies and refactor random number generation

- Bump versions of several dependencies in Cargo.toml for improved functionality and security, including:
  - socket2 to 0.6
  - nix to 0.31
  - toml to 1.0
  - x509-parser to 0.18
  - dashmap to 6.1
  - rand to 0.10
  - reqwest to 0.13
  - notify to 8.2
  - ipnetwork to 0.21
  - webpki-roots to 1.0
  - criterion to 0.8
- Introduce `OnceLock` for secure random number generation in multiple modules to ensure thread safety and reduce overhead.
- Refactor random number generation calls to use the new `RngExt` trait methods for consistency and clarity.
- Add new PNG files for architectural documentation.
This commit is contained in:
David Osipov
2026-03-21 15:43:07 +04:00
parent b930ea1ec5
commit c8632de5b6
26 changed files with 507 additions and 305 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ pub fn configure_tcp_socket(
let socket = socket2::SockRef::from(stream);
// Disable Nagle's algorithm for lower latency
socket.set_nodelay(true)?;
socket.set_tcp_nodelay(true)?;
// Set keepalive if enabled
if keepalive {
@@ -54,7 +54,7 @@ pub fn configure_client_socket(
let socket = socket2::SockRef::from(stream);
// Disable Nagle's algorithm
socket.set_nodelay(true)?;
socket.set_tcp_nodelay(true)?;
// Set keepalive
let keepalive = TcpKeepalive::new()
@@ -129,7 +129,7 @@ pub fn create_outgoing_socket_bound(addr: SocketAddr, bind_addr: Option<IpAddr>)
socket.set_nonblocking(true)?;
// Disable Nagle
socket.set_nodelay(true)?;
socket.set_tcp_nodelay(true)?;
socket.set_recv_buffer_size(DEFAULT_SOCKET_BUFFER_BYTES)?;
socket.set_send_buffer_size(DEFAULT_SOCKET_BUFFER_BYTES)?;