Skip to content

Commit eaa83bc

Browse files
Merge branch 'main' into quic-address-discovery
2 parents b0f0a30 + a4c886c commit eaa83bc

File tree

27 files changed

+180
-100
lines changed

27 files changed

+180
-100
lines changed

.github/workflows/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: taiki-e/install-action@cargo-llvm-cov
1717
- run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
1818
- name: Upload coverage to Codecov
19-
uses: codecov/codecov-action@v4
19+
uses: codecov/codecov-action@v5
2020
with:
2121
token: ${{ secrets.CODECOV_TOKEN }}
2222
files: lcov.info

.github/workflows/rust.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,28 @@ jobs:
6060
6161
cargo build --all-targets && cargo test && cargo test --manifest-path fuzz/Cargo.toml && cargo test -p quinn-udp --benches
6262
63+
test-solaris:
64+
name: test on solaris
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: test on Solaris
69+
uses: vmactions/solaris-vm@v1
70+
with:
71+
release: "11.4-gcc"
72+
usesh: true
73+
mem: 4096
74+
copyback: false
75+
prepare: |
76+
source <(curl -s https://raw.githubusercontent.com/psumbera/solaris-rust/refs/heads/main/sh.rust-web-install)
77+
echo "~~~~ rustc --version ~~~~"
78+
rustc --version
79+
echo "~~~~ Solaris-version ~~~~"
80+
uname -a
81+
run: |
82+
export PATH=$HOME/.rust_solaris/bin:$PATH
83+
cargo build --all-targets && cargo test && cargo test --manifest-path fuzz/Cargo.toml && cargo test -p quinn-udp --benches
84+
6385
test:
6486
strategy:
6587
matrix:
@@ -121,11 +143,6 @@ jobs:
121143

122144
- name: Install cargo binstall
123145
uses: cargo-bins/cargo-binstall@main
124-
125-
# We need to downgrade cc to version 1.1.31 for ring Wasm compilation to work.
126-
# See the upstream issue https://github.com/rust-lang/cc-rs/issues/1275
127-
- name: Use working `cc` version 1.1.31
128-
run: cargo update -p cc --precise 1.1.31
129146

130147
- name: build wasm32 tests (quinn-proto)
131148
run: cargo test -p quinn-proto --target wasm32-unknown-unknown --no-run
@@ -146,6 +163,7 @@ jobs:
146163
runs-on: ubuntu-latest
147164
steps:
148165
- uses: actions/checkout@v4
166+
# Note that we must also update the README when changing the MSRV
149167
- uses: dtolnay/[email protected]
150168
- uses: Swatinem/rust-cache@v2
151169
- run: cargo check --lib --all-features -p quinn-udp -p quinn-proto -p quinn

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The project was founded by [Dirkjan Ochtman](https://github.com/djc) and
2424
[rustls][rustls] and [*ring*][ring]
2525
- Application-layer datagrams for small, unreliable messages
2626
- Future-based async API
27-
- Minimum supported Rust version of 1.66
27+
- Minimum supported Rust version of 1.70
2828

2929
## Overview
3030

deny.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ allow = [
77
"MIT",
88
"MPL-2.0",
99
"OpenSSL",
10-
"Unicode-DFS-2016",
10+
"Unicode-3.0",
1111
]
1212
private = { ignore = true }
1313

perf/src/bin/perf_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ async fn request(
308308

309309
let send_stream_stats = stream_stats.new_sender(&send, upload);
310310

311-
const DATA: [u8; 1024 * 1024] = [42; 1024 * 1024];
311+
static DATA: [u8; 1024 * 1024] = [42; 1024 * 1024];
312312
while upload > 0 {
313313
let chunk_len = upload.min(DATA.len() as u64);
314314
send.write_chunk(Bytes::from_static(&DATA[..chunk_len as usize]))

perf/src/bin/perf_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ async fn drain_stream(mut stream: quinn::RecvStream) -> Result<()> {
215215
}
216216

217217
async fn respond(mut bytes: u64, mut stream: quinn::SendStream) -> Result<()> {
218-
const DATA: [u8; 1024 * 1024] = [42; 1024 * 1024];
218+
static DATA: [u8; 1024 * 1024] = [42; 1024 * 1024];
219219

220220
while bytes > 0 {
221221
let chunk_len = bytes.min(DATA.len() as u64);

quinn-proto/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "quinn-proto"
3-
version = "0.11.9"
3+
version = "0.11.10"
44
edition.workspace = true
55
rust-version.workspace = true
66
license.workspace = true
@@ -10,9 +10,6 @@ keywords.workspace = true
1010
categories.workspace = true
1111
workspace = ".."
1212

13-
[package.metadata.docs.rs]
14-
all-features = true
15-
1613
[features]
1714
default = ["rustls-ring", "log"]
1815
aws-lc-rs = ["dep:aws-lc-rs", "aws-lc-rs?/aws-lc-sys", "aws-lc-rs?/prebuilt-nasm"]
@@ -66,3 +63,7 @@ wasm-bindgen-test = { workspace = true }
6663
[lints.rust]
6764
# https://rust-fuzz.github.io/book/cargo-fuzz/guide.html#cfgfuzzing
6865
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
66+
67+
[package.metadata.docs.rs]
68+
# all non-default features except fips (cannot build on docs.rs environment)
69+
features = ["rustls-aws-lc-rs", "rustls-ring", "platform-verifier", "log", "rustls-log"]

quinn-proto/src/connection/ack_frequency.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ impl AckFrequencyState {
121121
) -> Result<bool, TransportError> {
122122
if self
123123
.last_ack_frequency_frame
124-
.map_or(false, |highest_sequence_nr| {
125-
frame.sequence.into_inner() <= highest_sequence_nr
126-
})
124+
.is_some_and(|highest_sequence_nr| frame.sequence.into_inner() <= highest_sequence_nr)
127125
{
128126
return Ok(false);
129127
}

quinn-proto/src/connection/mod.rs

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use crate::{
3232
token::ResetToken,
3333
transport_parameters::TransportParameters,
3434
Dir, Duration, EndpointConfig, Frame, Instant, Side, StreamId, Transmit, TransportError,
35-
TransportErrorCode, VarInt, MAX_CID_SIZE, MAX_STREAM_COUNT, MIN_INITIAL_SIZE,
35+
TransportErrorCode, VarInt, INITIAL_MTU, MAX_CID_SIZE, MAX_STREAM_COUNT, MIN_INITIAL_SIZE,
3636
TIMER_GRANULARITY,
3737
};
3838

@@ -700,13 +700,21 @@ impl Connection {
700700
// waste large amounts of bandwidth. The exact threshold is a bit arbitrary
701701
// and might benefit from further tuning, though there's no universally
702702
// optimal value.
703+
//
704+
// Additionally, if this datagram is a loss probe and `segment_size` is
705+
// larger than `INITIAL_MTU`, then padding it to `segment_size` to continue
706+
// the GSO batch would risk failure to recover from a reduction in path
707+
// MTU. Loss probes are the only packets for which we might grow
708+
// `buf_capacity` by less than `segment_size`.
703709
const MAX_PADDING: usize = 16;
704710
let packet_len_unpadded = cmp::max(builder.min_size, buf.len())
705711
- datagram_start
706712
+ builder.tag_len;
707-
if packet_len_unpadded + MAX_PADDING < segment_size {
713+
if packet_len_unpadded + MAX_PADDING < segment_size
714+
|| datagram_start + segment_size > buf_capacity
715+
{
708716
trace!(
709-
"GSO truncated by demand for {} padding bytes",
717+
"GSO truncated by demand for {} padding bytes or loss probe",
710718
segment_size - packet_len_unpadded
711719
);
712720
builder_storage = Some(builder);
@@ -749,7 +757,17 @@ impl Connection {
749757
}
750758

751759
// Allocate space for another datagram
752-
buf_capacity += segment_size;
760+
let next_datagram_size_limit = match self.spaces[space_id].loss_probes {
761+
0 => segment_size,
762+
_ => {
763+
self.spaces[space_id].loss_probes -= 1;
764+
// Clamp the datagram to at most the minimum MTU to ensure that loss probes
765+
// can get through and enable recovery even if the path MTU has shrank
766+
// unexpectedly.
767+
usize::from(INITIAL_MTU)
768+
}
769+
};
770+
buf_capacity += next_datagram_size_limit;
753771
if buf.capacity() < buf_capacity {
754772
// We reserve the maximum space for sending `max_datagrams` upfront
755773
// to avoid any reallocations if more datagrams have to be appended later on.
@@ -963,14 +981,10 @@ impl Connection {
963981
// Send MTU probe if necessary
964982
if buf.is_empty() && self.state.is_established() {
965983
let space_id = SpaceId::Data;
966-
let probe_size = match self
984+
let probe_size = self
967985
.path
968986
.mtud
969-
.poll_transmit(now, self.packet_number_filter.peek(&self.spaces[space_id]))
970-
{
971-
Some(next_probe_size) => next_probe_size,
972-
None => return None,
973-
};
987+
.poll_transmit(now, self.packet_number_filter.peek(&self.spaces[space_id]))?;
974988

975989
let buf_capacity = probe_size as usize;
976990
buf.reserve(buf_capacity);
@@ -1645,7 +1659,7 @@ impl Connection {
16451659
None if self
16461660
.path
16471661
.first_packet_after_rtt_sample
1648-
.map_or(false, |x| x < (pn_space, packet)) =>
1662+
.is_some_and(|x| x < (pn_space, packet)) =>
16491663
{
16501664
persistent_congestion_start = Some(info.time_sent);
16511665
}
@@ -2220,7 +2234,7 @@ impl Connection {
22202234
let _guard = span.enter();
22212235

22222236
let is_duplicate = |n| self.spaces[packet.header.space()].dedup.insert(n);
2223-
if number.map_or(false, is_duplicate) {
2237+
if number.is_some_and(is_duplicate) {
22242238
debug!("discarding possible duplicate packet");
22252239
return;
22262240
} else if self.state.is_handshake() && packet.header.is_short() {
@@ -3640,13 +3654,13 @@ impl Connection {
36403654
|| self
36413655
.prev_path
36423656
.as_ref()
3643-
.map_or(false, |(_, x)| x.challenge_pending)
3657+
.is_some_and(|(_, x)| x.challenge_pending)
36443658
|| !self.path_responses.is_empty()
36453659
|| self
36463660
.datagrams
36473661
.outgoing
36483662
.front()
3649-
.map_or(false, |x| x.size(true) <= max_size)
3663+
.is_some_and(|x| x.size(true) <= max_size)
36503664
}
36513665

36523666
/// Update counters to account for a packet becoming acknowledged, lost, or abandoned

quinn-proto/src/connection/mtud.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl BlackHoleDetector {
417417
let end_last_burst = self
418418
.current_loss_burst
419419
.as_ref()
420-
.map_or(false, |current| pn - current.latest_non_probe != 1);
420+
.is_some_and(|current| pn - current.latest_non_probe != 1);
421421

422422
if end_last_burst {
423423
self.finish_loss_burst();

0 commit comments

Comments
 (0)