mirror of
https://github.com/telemt/telemt.git
synced 2026-11-22 07:16:38 +03:00
feat(client_mss): chunk only the start of the initial server response
With client_mss_bulk the whole authenticated FakeTLS response (ServerHello, CCS, emulated certificate records, tickets - typically ~4 KiB) was written in client_mss-sized chunks: about 50 segments at `tspu`. With ~2% loss at least one segment is lost in ~64% of handshakes, and the burst takes several RTTs to pass the initial congestion window. - New server.client_mss_prefix (Linux, requires client_mss_bulk): `full` (default, current behavior), `server-hello` (through the end of the first TLS record, capped at 2048 bytes, falls back to `full` on unexpected input) or a byte count. Only that prefix is written in MSG_EOR chunks; the rest goes out in one write at the bulk MSS. - Chunk payload accounts for TCP timestamps and never exceeds tcpi_snd_mss. - Removed TcpMaxSegmentGuard: TCP_MAXSEG on an established socket does not change the MSS of outgoing segments on Linux, and its getsockopt/setsockopt failures no longer abort the handshake. TCP_NODELAY is set once. - Docs (en/ru/de), API discovery metadata, strict keys, reload diff.
This commit is contained in:
@@ -124,11 +124,20 @@ pub(super) fn validate_listener_runtime_profiles(config: &ProxyConfig) -> Result
|
||||
}
|
||||
}
|
||||
|
||||
let prefix = config
|
||||
.server
|
||||
.client_mss_prefix_value()
|
||||
.map_err(|error| ProxyError::Config(format!("server.client_mss_prefix {error}")))?;
|
||||
let Some(bulk_mss) = config
|
||||
.server
|
||||
.client_mss_bulk_value()
|
||||
.map_err(|error| ProxyError::Config(format!("server.client_mss_bulk {error}")))?
|
||||
else {
|
||||
if prefix.is_some() {
|
||||
return Err(ProxyError::Config(
|
||||
"server.client_mss_prefix requires server.client_mss_bulk".to_string(),
|
||||
));
|
||||
}
|
||||
return Ok(());
|
||||
};
|
||||
if !cfg!(target_os = "linux") {
|
||||
|
||||
Reference in New Issue
Block a user