Skip to content

Commit 877dcca

Browse files
dignifiedquireRalithlarseggertstormshield-fabsZotyamester
authored
chore: sync with quinn@main (#606)
Synced up to quinn-rs/quinn@07ce61c Closes #602 ### Commits applied in this PR | upstream SHA | PR | subject | noq commit | |---|---|---|---| | 06f7f7d | [#2611](quinn-rs/quinn#2611) | Take boxed connection ID generator factories | `167c709c7` | | 404db1b | [#2495](quinn-rs/quinn#2495) | Move the ref counts out | `e6772ea9f` (bundled) | | 4b7a039 | [#2495](quinn-rs/quinn#2495) | Fix the (pre-existing) rightward drift by inverting conditions | `e6772ea9f` (bundled) | | 475b55b | [#2495](quinn-rs/quinn#2495) | Early return in `RecvStream::drop()` | `e6772ea9f` (bundled) | | 803c814 | [#2541](quinn-rs/quinn#2541) | Remove `RecvStream`s from `blocked_readers` on `stop` | `e6772ea9f` (bundled) | | 37625fe | [#2609](quinn-rs/quinn#2609) | quinn: fix ref count logic for ConnectionRef and EndpointRef | `e6772ea9f` (bundled) | | 07ce61c | [#2612](quinn-rs/quinn#2612) | Test cleanup of connections/endpoints when all references are dropped | `e6772ea9f` (bundled) | | 42de9dd | [#2469](quinn-rs/quinn#2469) | refactor(quinn-udp): extract `decode_socket_addr` helper | `2e4effbe4` | | 4742a70 | [#2469](quinn-rs/quinn#2469) | refactor(quinn-udp): extract `ControlMetadata` helper | `6f5904350` | | 2964782 | [#2472](quinn-rs/quinn#2472) | refactor(quinn-udp): split fast&slow send/recv paths | `a17058e80` | | 459c347 | [#2549](quinn-rs/quinn#2549) | add metric for spurious congestion events | `0c78d6435` | | f853e5e | [#2550](quinn-rs/quinn#2550) | fix(perf): suppress table output in JSON mode | `0155ee3f6` | | a0ec97a | [#2463](quinn-rs/quinn#2463) | feat(quinn-udp): make Apple fast datapath opt-in | `412dc6684` | | bb00530 | [#2560](quinn-rs/quinn#2560) | docs: fix book build with mdbook 0.5.2 | `98cb0ad67` | | ee8f946 | [#2565](quinn-rs/quinn#2565) | fix: reuse existing socket for probing GRO/GSO support | `012530527` | | 56bba7c | [#2565](quinn-rs/quinn#2565) | refactor: remove `gro` module | `1174207fa` | | 04ba57c | [#2565](quinn-rs/quinn#2565) | fix: remove opportunistic GRO syscall | `35400c04e` | | f0905db | [#2570](quinn-rs/quinn#2570) | docs(quinn): improve `Connection::close_reason()` documentation | `287fd2b63` | | 0adcd20 | [#2573](quinn-rs/quinn#2573) | docs: clarify that `Event::ConnectionLost` is not emitted on local close | `7f34b4517` | | b8e4d3b | [#2572](quinn-rs/quinn#2572) | quinn: Make Endpoint::server dual-stack V6 by default | `461fe7f28` | | 52c7ad1 | [#2583](quinn-rs/quinn#2583) | refactor(quinn-udp): add `retry_if_interrupted` helper | `348b91383` | | 8acb578 | [#2584](quinn-rs/quinn#2584) | fix(unix): disable GSO after probing | `85c022d75` | | e01f99e | [#2571](quinn-rs/quinn#2571) | fix: Resolve `sendmsg_x`/`recvmsg_x` via `dlsym` | `881d6f151` | | eff5572 | [#2579](quinn-rs/quinn#2579) | proto: send STREAMS_BLOCKED when stream limit is hit | `e64abef10` | | dc86400 | [#2556](quinn-rs/quinn#2556) | Introduce `max_outgoing_bytes_per_second` option | `ffe5a5474` | | bda24fd | [#2602](quinn-rs/quinn#2602) | Upgrade rustls-platform-verifier to 0.7 | `e4570ea71` | ### Already present in noq | upstream SHA | PR | subject | |---|---|---| | 16e1aaa | [#2511](quinn-rs/quinn#2511) | Fix unused_mut warning from Rust 1.93 | | e96c279 | [#2533](quinn-rs/quinn#2533) | quinn-proto: make cids_exhausted overflow-safe on 32-bit | | 5db36fe | [#2534](quinn-rs/quinn#2534) | docs: fix typo in EndpointStats | | d305440 | [#2540](quinn-rs/quinn#2540) | Upgrade fastbloom to 0.17 | | 57b9d0a | [#2558](quinn-rs/quinn#2558) | fuzz: add fuzzing target for parsing transport parameters | | 655a8ad | [#2558](quinn-rs/quinn#2558) | proto: avoid unwrapping varint decoding during parameters parsing | | 7f7d9ea | [#2610](quinn-rs/quinn#2610) | Fix clippy warnings from 1.95 ### Skipped | upstream SHA | PR | subject | reason | |---|---|---|---| | e5b30f5 | [#2532](quinn-rs/quinn#2532) | quinn-udp: make ECN best-effort on Windows (Wine/Proton) | noq already has its own Wine/Proton ECN handling using `AtomicBool` runtime-detection (noq PR [#414](#414)); upstream's static-bool approach would be redundant. | | 70d083b | [#2540](quinn-rs/quinn#2540) | Upgrade to qlog 0.16 | noq uses its own `n0-qlog` fork with a different API. | | d8db7a0 | [#2599](quinn-rs/quinn#2599) | Upgrade to qlog 0.17 | Same reason as above. | | 41bf1db | [#2564](quinn-rs/quinn#2564) | fix: evaluate `max_gso_segments` for every socket on Windows | noq already tracks `max_gso_segments` per-socket on an `AtomicUsize`. | | 905e109 | [#2599](quinn-rs/quinn#2599) | Bump MSRV to 1.82 (for qlog -> serde_with) | noq is already at MSRV 1.88. | | 95863af | [#2602](quinn-rs/quinn#2602) | Bump MSRV to 1.85 (for rustls-platform-verifier) | Same reason as above. | --------- Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com> Co-authored-by: Lars Eggert <lars@eggert.org> Co-authored-by: Fabien SAVY <fabien.savy@stormshield.eu> Co-authored-by: Zotyamester <szatmary.zoltan1222@gmail.com> Co-authored-by: Dirkjan Ochtman <dirkjan@ochtman.nl> Co-authored-by: Thomas Eizinger <thomas@eizinger.io> Co-authored-by: zphrs <z@zephiris.dev> Co-authored-by: alexchenai <alexchenai@users.noreply.github.com> Co-authored-by: Romain Roffé <r2@kyber.media> Co-authored-by: cong-or <conchubhar.gannon@gmail.com> Co-authored-by: Adolfo Ochagavía <github@adolfo.ochagavia.nl>
2 parents 2e1739d + 79b20f4 commit 877dcca

28 files changed

Lines changed: 1039 additions & 351 deletions

Cargo.lock

Lines changed: 55 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ rustc-hash = "2"
4444
rustls = { version = "0.23.33", default-features = false, features = ["std"] }
4545
rustls-pemfile = "2"
4646
rustls-pki-types = "1.7"
47-
rustls-platform-verifier = "0.6"
47+
rustls-platform-verifier = "0.7"
4848
serde = { version = "1.0", features = ["derive"] }
4949
serde_json = "1"
5050
slab = "0.4.9"

deny.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ allow = [
1313
"ISC",
1414
"MIT",
1515
"NCSA",
16-
"OpenSSL",
16+
"OpenSSL", # aws-lc-fips-sys
1717
"Unicode-3.0",
1818
"Zlib", # foldhash, dependency of fastbloom
1919
]
@@ -28,9 +28,6 @@ skip = [
2828
# ring uses getrandom 0.2, newer crates use 0.3
2929
{ crate = "getrandom", reason = "ring depends on 0.2, newer ecosystem uses 0.3" },
3030
{ crate = "r-efi", reason = "proptest dev-dependency pulls in old getrandom" },
31-
# jni and redox_users use thiserror 1.x
32-
{ crate = "thiserror", reason = "transitive deps use thiserror 1.x" },
33-
{ crate = "thiserror-impl", reason = "follows thiserror" },
3431
# follows getrandom versions
3532
{ crate = "wasi", reason = "follows getrandom version split" },
3633
# various transitive deps require different windows-sys versions

docs/book/book.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[book]
22
authors = ["Timon Post"]
33
language = "en"
4-
multilingual = false
54
src = "src"
65
title = "noq"

noq-proto/src/config/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ impl EndpointConfig {
8080
/// information in local connection IDs, e.g. to support stateless packet-level load balancers.
8181
///
8282
/// Defaults to [`HashedConnectionIdGenerator`].
83-
pub fn cid_generator<F: Fn() -> Box<dyn ConnectionIdGenerator> + Send + Sync + 'static>(
83+
pub fn cid_generator(
8484
&mut self,
85-
factory: F,
85+
factory: Arc<dyn Fn() -> Box<dyn ConnectionIdGenerator> + Send + Sync>,
8686
) -> &mut Self {
87-
self.connection_id_generator_factory = Arc::new(factory);
87+
self.connection_id_generator_factory = factory;
8888
self
8989
}
9090

noq-proto/src/config/transport.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub struct TransportConfig {
6060
pub(crate) mtu_discovery_config: Option<MtuDiscoveryConfig>,
6161
pub(crate) pad_to_mtu: bool,
6262
pub(crate) ack_frequency_config: Option<AckFrequencyConfig>,
63+
pub(crate) max_outgoing_bytes_per_second: Option<u64>,
6364

6465
pub(crate) persistent_congestion_threshold: u32,
6566
pub(crate) keep_alive_interval: Option<Duration>,
@@ -272,6 +273,14 @@ impl TransportConfig {
272273
self
273274
}
274275

276+
/// Configures an outbound rate limit (in bytes per second) for each connection.
277+
///
278+
/// Defaults to `None`, which disables rate limiting.
279+
pub fn max_outgoing_bytes_per_second(&mut self, value: Option<u64>) -> &mut Self {
280+
self.max_outgoing_bytes_per_second = value;
281+
self
282+
}
283+
275284
/// Number of consecutive PTOs after which network is considered to be experiencing persistent congestion.
276285
pub fn persistent_congestion_threshold(&mut self, value: u32) -> &mut Self {
277286
self.persistent_congestion_threshold = value;
@@ -558,6 +567,7 @@ impl Default for TransportConfig {
558567
mtu_discovery_config: Some(MtuDiscoveryConfig::default()),
559568
pad_to_mtu: false,
560569
ack_frequency_config: None,
570+
max_outgoing_bytes_per_second: None,
561571

562572
persistent_congestion_threshold: 3,
563573
keep_alive_interval: None,
@@ -606,6 +616,7 @@ impl fmt::Debug for TransportConfig {
606616
mtu_discovery_config,
607617
pad_to_mtu,
608618
ack_frequency_config,
619+
max_outgoing_bytes_per_second,
609620
persistent_congestion_threshold,
610621
keep_alive_interval,
611622
crypto_buffer_size,
@@ -641,6 +652,10 @@ impl fmt::Debug for TransportConfig {
641652
.field("mtu_discovery_config", mtu_discovery_config)
642653
.field("pad_to_mtu", pad_to_mtu)
643654
.field("ack_frequency_config", ack_frequency_config)
655+
.field(
656+
"max_outgoing_bytes_per_second",
657+
max_outgoing_bytes_per_second,
658+
)
644659
.field(
645660
"persistent_congestion_threshold",
646661
persistent_congestion_threshold,

0 commit comments

Comments
 (0)