Bump -> 3.4.19

This commit is contained in:
Alexey
2026-06-24 00:53:01 +03:00
parent 87c82c2a63
commit f56895feac
8 changed files with 169 additions and 359 deletions
+7 -8
View File
@@ -240,7 +240,10 @@ fn open_append_file(path: &Path) -> io::Result<(File, u64)> {
let file = match options.open(path) {
Ok(file) => file,
Err(error) => {
let Some(parent) = path.parent().filter(|parent| !parent.as_os_str().is_empty()) else {
let Some(parent) = path
.parent()
.filter(|parent| !parent.as_os_str().is_empty())
else {
return Err(error);
};
fs::create_dir_all(parent)?;
@@ -259,13 +262,9 @@ fn active_path_for(
) -> PathBuf {
match rotation {
LogRotation::Never => dir.join(base_name),
LogRotation::Minutely
| LogRotation::Hourly
| LogRotation::Daily
| LogRotation::Weekly => dir.join(format!(
"{base_name}.{}",
period_suffix_for(rotation, now)
)),
LogRotation::Minutely | LogRotation::Hourly | LogRotation::Daily | LogRotation::Weekly => {
dir.join(format!("{base_name}.{}", period_suffix_for(rotation, now)))
}
}
}
+1 -1
View File
@@ -20,9 +20,9 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Mutex, OnceLock};
use std::time::{Duration, Instant as StdInstant};
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
use tokio::net::{TcpStream, lookup_host};
#[cfg(unix)]
use tokio::net::UnixStream;
use tokio::net::{TcpStream, lookup_host};
#[cfg(unix)]
use tokio::sync::Mutex as AsyncMutex;
use tokio::time::{Instant, timeout};
+1 -2
View File
@@ -52,8 +52,7 @@ use self::c2me::{
};
use self::d2c::{
MeD2cFlushPolicy, MeWriterResponseOutcome, classify_me_d2c_flush_reason,
flush_client_or_cancel, me_d2c_flush_reason_requires_client_flush,
observe_me_d2c_flush_event,
flush_client_or_cancel, me_d2c_flush_reason_requires_client_flush, observe_me_d2c_flush_event,
process_me_writer_response_with_traffic_lease,
};
use self::desync::{RelayForensicsState, hash_ip_in, report_desync_frame_too_large_in};
+4 -8
View File
@@ -307,14 +307,10 @@ pub(in crate::proxy::middle_relay) fn compute_intermediate_secure_wire_len(
let wire_len = data_len
.checked_add(padding_len)
.ok_or_else(|| ProxyError::Proxy("Frame length overflow".into()))?;
let len_val =
crate::protocol::framing::encode_intermediate_header(wire_len, quickack).ok_or_else(
|| {
ProxyError::Proxy(format!(
"Intermediate/Secure frame too large: {wire_len}"
))
},
)?;
let len_val = crate::protocol::framing::encode_intermediate_header(wire_len, quickack)
.ok_or_else(|| {
ProxyError::Proxy(format!("Intermediate/Secure frame too large: {wire_len}"))
})?;
let total = 4usize
.checked_add(wire_len)
.ok_or_else(|| ProxyError::Proxy("Frame buffer size overflow".into()))?;
+1 -5
View File
@@ -237,11 +237,7 @@ where
Err(e) => return Err(e),
}
let header = crate::protocol::framing::parse_intermediate_header(len_buf);
(
header.wire_len,
header.quickack,
Some(len_buf),
)
(header.wire_len, header.quickack, Some(len_buf))
}
};
+5 -8
View File
@@ -371,9 +371,10 @@ impl<W: AsyncWrite + Unpin> SecureIntermediateFrameWriter<W> {
let padding_len = secure_padding_len(data.len(), &self.rng);
let padding = self.rng.bytes(padding_len);
let total_len = data.len().checked_add(padding_len).ok_or_else(|| {
Error::new(ErrorKind::InvalidInput, "secure frame length overflow")
})?;
let total_len = data
.len()
.checked_add(padding_len)
.ok_or_else(|| Error::new(ErrorKind::InvalidInput, "secure frame length overflow"))?;
let len = encode_intermediate_header(total_len, meta.quickack).ok_or_else(|| {
Error::new(
ErrorKind::InvalidInput,
@@ -564,11 +565,7 @@ impl<R: AsyncRead + Unpin> FrameReaderKind<R> {
Self::with_max_frame_size(upstream, proto_tag, DEFAULT_MAX_FRAME_SIZE)
}
fn with_max_frame_size(
upstream: R,
proto_tag: ProtoTag,
max_frame_size: usize,
) -> Self {
fn with_max_frame_size(upstream: R, proto_tag: ProtoTag, max_frame_size: usize) -> Self {
match proto_tag {
ProtoTag::Abridged => FrameReaderKind::Abridged(
AbridgedFrameReader::with_max_frame_size(upstream, max_frame_size),