Bug 1866046 - neqo v0.6.8 r=necko-reviewers,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D194375
This commit is contained in:
Manuel Bucher 2023-11-22 13:41:54 +00:00
parent 00e5d5a924
commit 36cc48dd22
20 changed files with 229 additions and 157 deletions

View File

@ -85,9 +85,9 @@ git = "https://github.com/mozilla/mp4parse-rust"
rev = "d262e40e7b80f949dcdb4db21caa6dbf1a8b2043"
replace-with = "vendored-sources"
[source."git+https://github.com/mozilla/neqo?tag=v0.6.7"]
[source."git+https://github.com/mozilla/neqo?tag=v0.6.8"]
git = "https://github.com/mozilla/neqo"
tag = "v0.6.7"
tag = "v0.6.8"
replace-with = "vendored-sources"
[source."git+https://github.com/mozilla/uniffi-rs.git?rev=c0e64b839018728d8153ce1758d391b7782e2e21"]

20
Cargo.lock generated
View File

@ -3780,8 +3780,8 @@ dependencies = [
[[package]]
name = "neqo-common"
version = "0.6.7"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.7#8a3aaa26c97d41a65a0de0cba885667c930ca61d"
version = "0.6.8"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.8#83735a88217a6b3a6a9d3cd5d9243040c5e41319"
dependencies = [
"env_logger",
"lazy_static",
@ -3793,8 +3793,8 @@ dependencies = [
[[package]]
name = "neqo-crypto"
version = "0.6.7"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.7#8a3aaa26c97d41a65a0de0cba885667c930ca61d"
version = "0.6.8"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.8#83735a88217a6b3a6a9d3cd5d9243040c5e41319"
dependencies = [
"bindgen 0.64.999",
"log",
@ -3807,8 +3807,8 @@ dependencies = [
[[package]]
name = "neqo-http3"
version = "0.6.7"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.7#8a3aaa26c97d41a65a0de0cba885667c930ca61d"
version = "0.6.8"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.8#83735a88217a6b3a6a9d3cd5d9243040c5e41319"
dependencies = [
"enumset",
"lazy_static",
@ -3825,8 +3825,8 @@ dependencies = [
[[package]]
name = "neqo-qpack"
version = "0.6.7"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.7#8a3aaa26c97d41a65a0de0cba885667c930ca61d"
version = "0.6.8"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.8#83735a88217a6b3a6a9d3cd5d9243040c5e41319"
dependencies = [
"lazy_static",
"log",
@ -3839,8 +3839,8 @@ dependencies = [
[[package]]
name = "neqo-transport"
version = "0.6.7"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.7#8a3aaa26c97d41a65a0de0cba885667c930ca61d"
version = "0.6.8"
source = "git+https://github.com/mozilla/neqo?tag=v0.6.8#83735a88217a6b3a6a9d3cd5d9243040c5e41319"
dependencies = [
"indexmap 1.9.3",
"lazy_static",

View File

@ -9,10 +9,10 @@ license = "MPL-2.0"
name = "neqo_glue"
[dependencies]
neqo-http3 = { tag = "v0.6.7", git = "https://github.com/mozilla/neqo" }
neqo-transport = { tag = "v0.6.7", git = "https://github.com/mozilla/neqo" }
neqo-common = { tag = "v0.6.7", git = "https://github.com/mozilla/neqo" }
neqo-qpack = { tag = "v0.6.7", git = "https://github.com/mozilla/neqo" }
neqo-http3 = { tag = "v0.6.8", git = "https://github.com/mozilla/neqo" }
neqo-transport = { tag = "v0.6.8", git = "https://github.com/mozilla/neqo" }
neqo-common = { tag = "v0.6.8", git = "https://github.com/mozilla/neqo" }
neqo-qpack = { tag = "v0.6.8", git = "https://github.com/mozilla/neqo" }
nserror = { path = "../../../xpcom/rust/nserror" }
nsstring = { path = "../../../xpcom/rust/nsstring" }
xpcom = { path = "../../../xpcom/rust/xpcom" }
@ -27,7 +27,7 @@ uuid = { version = "1.0", features = ["v4"] }
winapi = {version = "0.3", features = ["ws2def"] }
[dependencies.neqo-crypto]
tag = "v0.6.7"
tag = "v0.6.8"
git = "https://github.com/mozilla/neqo"
default-features = false
features = ["gecko"]

View File

@ -6,10 +6,10 @@ edition = "2018"
license = "MPL-2.0"
[dependencies]
neqo-transport = { tag = "v0.6.7", git = "https://github.com/mozilla/neqo" }
neqo-common = { tag = "v0.6.7", git = "https://github.com/mozilla/neqo" }
neqo-http3 = { tag = "v0.6.7", git = "https://github.com/mozilla/neqo" }
neqo-qpack = { tag = "v0.6.7", git = "https://github.com/mozilla/neqo" }
neqo-transport = { tag = "v0.6.8", git = "https://github.com/mozilla/neqo" }
neqo-common = { tag = "v0.6.8", git = "https://github.com/mozilla/neqo" }
neqo-http3 = { tag = "v0.6.8", git = "https://github.com/mozilla/neqo" }
neqo-qpack = { tag = "v0.6.8", git = "https://github.com/mozilla/neqo" }
mio = "0.6.17"
mio-extras = "2.0.5"
log = "0.4.0"
@ -21,7 +21,7 @@ tokio = { version = "1", features = ["rt-multi-thread"] }
mozilla-central-workspace-hack = { version = "0.1", features = ["http3server"], optional = true }
[dependencies.neqo-crypto]
tag = "v0.6.7"
tag = "v0.6.8"
git = "https://github.com/mozilla/neqo"
default-features = false
features = ["gecko"]

View File

@ -1 +1 @@
{"files":{"Cargo.toml":"23282a86e4fbcbcf95e684fb00e36a74517ee8c9e5267fb76bea2ef29f3f3fe4","build.rs":"a17b1bb1bd3de3fc958f72d4d1357f7bc4432faa26640c95b5fbfccf40579d67","src/codec.rs":"beb895e819e48d77ac721573daea781d3407637d7f9682ffc73bac6375e83ad8","src/datagram.rs":"742aa0f39ac24d63431b58e23ebf925e27ec42340e5911020475de5f7f457a6d","src/event.rs":"f60fee9f4b09ef47ff5e4bfa21c07e45ffd5873c292f2605f24d834070127d62","src/header.rs":"467b947f78bfe354d8bb51e8df0c2be69e75a45e2be688d81f0d268aa77c89ef","src/hrtime.rs":"fdb72b347c94eefb2fa0bdb669cca4549853d7f767ad7572941adf265f1621f9","src/incrdecoder.rs":"f3b6e964d02c34e7c8fc5f048b4f99cc3b0f2567cabb2e078f0b7894e1baa50e","src/lib.rs":"b1d5f72196b9e846fdc10b099468e3f437b3121b3b2d72727a1f55b5c77c455c","src/log.rs":"2713e29de2d4718b65ad1b0d922702629845b830b195a5b01b018dc395039a85","src/qlog.rs":"c9f4a32950d405fdfbb317c61a4089fa1b75c5de40698e851a62413ceac46c8a","src/timer.rs":"8da10e8300be0795367e2823d3ecf7ec46bcadbedfc28ed5a013794bcd73cfc7","tests/log.rs":"480b165b7907ec642c508b303d63005eee1427115d6973a349eaf6b2242ed18d"},"package":null}
{"files":{"Cargo.toml":"b29d3a82e784eaa91625dd36e843cd34800e6528573eb7684cb34989b9a6cbc3","build.rs":"a17b1bb1bd3de3fc958f72d4d1357f7bc4432faa26640c95b5fbfccf40579d67","src/codec.rs":"a317da96f2a2e70313f1a6ed4741261191cef690db25dc789973fd980aafc77f","src/datagram.rs":"742aa0f39ac24d63431b58e23ebf925e27ec42340e5911020475de5f7f457a6d","src/event.rs":"f60fee9f4b09ef47ff5e4bfa21c07e45ffd5873c292f2605f24d834070127d62","src/header.rs":"467b947f78bfe354d8bb51e8df0c2be69e75a45e2be688d81f0d268aa77c89ef","src/hrtime.rs":"fdb72b347c94eefb2fa0bdb669cca4549853d7f767ad7572941adf265f1621f9","src/incrdecoder.rs":"f3b6e964d02c34e7c8fc5f048b4f99cc3b0f2567cabb2e078f0b7894e1baa50e","src/lib.rs":"b1d5f72196b9e846fdc10b099468e3f437b3121b3b2d72727a1f55b5c77c455c","src/log.rs":"2713e29de2d4718b65ad1b0d922702629845b830b195a5b01b018dc395039a85","src/qlog.rs":"c9f4a32950d405fdfbb317c61a4089fa1b75c5de40698e851a62413ceac46c8a","src/timer.rs":"8da10e8300be0795367e2823d3ecf7ec46bcadbedfc28ed5a013794bcd73cfc7","tests/log.rs":"480b165b7907ec642c508b303d63005eee1427115d6973a349eaf6b2242ed18d"},"package":null}

View File

@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.65.0"
name = "neqo-common"
version = "0.6.7"
version = "0.6.8"
authors = ["Bobby Holley <bobbyholley@gmail.com>"]
build = "build.rs"
license = "MIT OR Apache-2.0"

View File

@ -37,13 +37,13 @@ impl<'a> Decoder<'a> {
/// # Panics
/// If the remaining quantity is less than `n`.
pub fn skip(&mut self, n: usize) {
assert!(self.remaining() >= n);
assert!(self.remaining() >= n, "insufficient data");
self.offset += n;
}
/// Skip helper that panics if `n` is `None` or not able to fit in `usize`.
fn skip_inner(&mut self, n: Option<u64>) {
self.skip(usize::try_from(n.unwrap()).unwrap());
self.skip(usize::try_from(n.expect("invalid length")).unwrap());
}
/// Skip a vector. Panics if there isn't enough space.
@ -545,7 +545,7 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "insufficient data")]
fn skip_too_much() {
let enc = Encoder::from_hex("ff");
let mut dec = enc.as_decoder();
@ -561,7 +561,7 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "insufficient data")]
fn skip_vec_too_much() {
let enc = Encoder::from_hex("ff1234");
let mut dec = enc.as_decoder();
@ -569,7 +569,7 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "invalid length")]
fn skip_vec_short_length() {
let enc = Encoder::from_hex("ff");
let mut dec = enc.as_decoder();
@ -584,7 +584,7 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "insufficient data")]
fn skip_vvec_too_much() {
let enc = Encoder::from_hex("0f1234");
let mut dec = enc.as_decoder();
@ -592,7 +592,7 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "invalid length")]
fn skip_vvec_short_length() {
let enc = Encoder::from_hex("ff");
let mut dec = enc.as_decoder();
@ -611,7 +611,7 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "Varint value too large")]
fn encoded_length_oob() {
_ = Encoder::varint_len(1 << 62);
}
@ -628,7 +628,7 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "Varint value too large")]
fn encoded_vvec_length_oob() {
_ = Encoder::vvec_len(1 << 62);
}
@ -752,7 +752,7 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "assertion failed")]
fn encode_vec_with_overflow() {
let mut enc = Encoder::default();
enc.encode_vec_with(1, |enc_inner| {

View File

@ -1 +1 @@
{"files":{"Cargo.toml":"e42a185ed52b2cf439503b5acd24a5fb40ca4d310b16dbe4120404c69c9c0939","TODO":"ac0f1c2ebcca03f5b3c0cc56c5aedbb030a4b511e438bc07a57361c789f91e9f","bindings/bindings.toml":"b1a04fda8f317d1cfb7dfdbe87f2887a825c054c61f4858d49f66b0429d8e27c","bindings/mozpkix.hpp":"77072c8bb0f6eb6bfe8cbadc111dcd92e0c79936d13f2e501aae1e5d289a6675","bindings/nspr_err.h":"2d5205d017b536c2d838bcf9bc4ec79f96dd50e7bb9b73892328781f1ee6629d","bindings/nspr_error.h":"e41c03c77b8c22046f8618832c9569fbcc7b26d8b9bbc35eea7168f35e346889","bindings/nspr_io.h":"085b289849ef0e77f88512a27b4d9bdc28252bd4d39c6a17303204e46ef45f72","bindings/nspr_time.h":"2e637fd338a5cf0fd3fb0070a47f474a34c2a7f4447f31b6875f5a9928d0a261","bindings/nss_ciphers.h":"95ec6344a607558b3c5ba8510f463b6295f3a2fb3f538a01410531045a5f62d1","bindings/nss_init.h":"ef49045063782fb612aff459172cc6a89340f15005808608ade5320ca9974310","bindings/nss_p11.h":"0b81e64fe6db49b2ecff94edd850be111ef99ec11220e88ceb1c67be90143a78","bindings/nss_secerr.h":"713e8368bdae5159af7893cfa517dabfe5103cede051dee9c9557c850a2defc6","bindings/nss_ssl.h":"af222fb957b989e392e762fa2125c82608a0053aff4fb97e556691646c88c335","bindings/nss_sslerr.h":"24b97f092183d8486f774cdaef5030d0249221c78343570d83a4ee5b594210ae","bindings/nss_sslopt.h":"b7807eb7abdad14db6ad7bc51048a46b065a0ea65a4508c95a12ce90e59d1eea","build.rs":"973971b2e1acd73efdb0166d5a4b07aa6ce1cf74fd02dc66d69fd2a74e521e48","src/aead.rs":"fd4c6669ad978cc4f7027b8cfac1228e84db288b294fdb0558e730bc1515136d","src/aead_fuzzing.rs":"20de62c7b23a048030a4ac7c7ef7ce53e31289f375a24ccb7e5c36c3625a62c1","src/agent.rs":"e83209eebcb27744110a8f650615ae765ae3d33881c3a23bf37dacc29860b787","src/agentio.rs":"bce4c3dfcfa433209a409ac0c0752f8c95ab37bb6239a42f99b83858e8747bd1","src/auth.rs":"ced1a18f691894984244088020ea25dc1ee678603317f0c7dfc8b8842fa750b4","src/cert.rs":"2a353b3230e3bd0c9ff91620a2e43c1dcaf493b1ff7997e6b51f8af589b925c1","src/constants.rs":"998e77bee88197a240032c1bfbddcff417a25ba82e576a0d2fe18ee9b63cefc7","src/ech.rs":"f67072f51dc52f7444c1983ba404b3db7366d84e9a798421d978ab244b6b57e9","src/err.rs":"8b2156f280c8823b2f9767bdd98fcf5c20ddc2e650301be005d1b96e15256f4a","src/exp.rs":"cec59d61fc95914f9703d2fb6490a8507af993c9db710dde894f2f8fd38123c7","src/ext.rs":"4b3bc6a9eb8f4d466e627281902f2385549531ea627a76d9b8d223f212c04284","src/hkdf.rs":"a53a414bc53dd080a9cb716e604aa73b81df80a8ef4f7406d54264e078e8a867","src/hp.rs":"7f98ef9b79262a3628f0bfdc6acd33d3c0ef4c20931b62c46ec0adcf2a337497","src/lib.rs":"59fbfc50f27addbdeac0dfd3e34f652eb51e2a3056ce11c587ff0da35b453843","src/once.rs":"b9850384899a1a016e839743d3489c0d4d916e1973746ef8c89872105d7d9736","src/p11.rs":"c2f70d8772c816761fb089000f1249af25754c7faf3c02dfd9e18bbfcbc6cbf6","src/prio.rs":"e5e169296c0ac69919c59fb6c1f8bd6bf079452eaa13d75da0edd41d435d3f6f","src/replay.rs":"ad019f543c36d217f7e4ec23cd46117c17aaca75d56147bfc80c286f208659d2","src/result.rs":"0587cbb6aace71a7f9765ef7c01dcd9f73a49dcc6331e1d8fe4de2aef6ca65b6","src/secrets.rs":"076b72410af797e48c528287159181acf30d5cf88c1213ad539d3446aecf7388","src/selfencrypt.rs":"6f39a62424048790e9a0b4660ed15644f09927b926b1dfa6d5e4695921d2e082","src/ssl.rs":"b16a5f154353a1cac1b5f887f25b8f934d60f9847e1e8e0e87ddaf980b64f530","src/time.rs":"88647eb712825cacf5b551e2d26abcad57b343fe3fbbaa3a94de75955247083c","tests/aead.rs":"5ee882f316c49b0217273583cb7c12396da444d7cdb60e354b40aac38fc70a63","tests/agent.rs":"101a905a1168d139d9b0a5598036eaf3e7b2c110644e01200a6a7ba0a65aa51f","tests/ext.rs":"6ad47ca33c55aa7e775b6dd4bab55144d17ac0aba3b8fdbc203ece6f11851a82","tests/handshake.rs":"d5d542203d9f322e39391fe2748b2de38ee11da1b5577cd81b179a8613e424a7","tests/hkdf.rs":"47830c1ea58a02d100522bdde6fabc02bb447ccb85affa0cdc44bc25da1be32a","tests/hp.rs":"97860a53b77dab5b16609b9102cc579fa62557b9094f3acfb82f5d32969a7335","tests/init.rs":"fc9e392b1efa0d8efb28952f73ffc05e5348e7b2b69207b60e375c3888a252a2","tests/selfencrypt.rs":"1125c858ec4e0a6994f34d162aa066cb003c61b324f268529ea04bcb641347cb"},"package":null}
{"files":{"Cargo.toml":"efe17a5183bd81198a0cee488fde3f73b0aabc79b9275018805e67bb9de50f4a","TODO":"ac0f1c2ebcca03f5b3c0cc56c5aedbb030a4b511e438bc07a57361c789f91e9f","bindings/bindings.toml":"b1a04fda8f317d1cfb7dfdbe87f2887a825c054c61f4858d49f66b0429d8e27c","bindings/mozpkix.hpp":"77072c8bb0f6eb6bfe8cbadc111dcd92e0c79936d13f2e501aae1e5d289a6675","bindings/nspr_err.h":"2d5205d017b536c2d838bcf9bc4ec79f96dd50e7bb9b73892328781f1ee6629d","bindings/nspr_error.h":"e41c03c77b8c22046f8618832c9569fbcc7b26d8b9bbc35eea7168f35e346889","bindings/nspr_io.h":"085b289849ef0e77f88512a27b4d9bdc28252bd4d39c6a17303204e46ef45f72","bindings/nspr_time.h":"2e637fd338a5cf0fd3fb0070a47f474a34c2a7f4447f31b6875f5a9928d0a261","bindings/nss_ciphers.h":"95ec6344a607558b3c5ba8510f463b6295f3a2fb3f538a01410531045a5f62d1","bindings/nss_init.h":"ef49045063782fb612aff459172cc6a89340f15005808608ade5320ca9974310","bindings/nss_p11.h":"0b81e64fe6db49b2ecff94edd850be111ef99ec11220e88ceb1c67be90143a78","bindings/nss_secerr.h":"713e8368bdae5159af7893cfa517dabfe5103cede051dee9c9557c850a2defc6","bindings/nss_ssl.h":"af222fb957b989e392e762fa2125c82608a0053aff4fb97e556691646c88c335","bindings/nss_sslerr.h":"24b97f092183d8486f774cdaef5030d0249221c78343570d83a4ee5b594210ae","bindings/nss_sslopt.h":"b7807eb7abdad14db6ad7bc51048a46b065a0ea65a4508c95a12ce90e59d1eea","build.rs":"973971b2e1acd73efdb0166d5a4b07aa6ce1cf74fd02dc66d69fd2a74e521e48","src/aead.rs":"fd4c6669ad978cc4f7027b8cfac1228e84db288b294fdb0558e730bc1515136d","src/aead_fuzzing.rs":"20de62c7b23a048030a4ac7c7ef7ce53e31289f375a24ccb7e5c36c3625a62c1","src/agent.rs":"3b189ab5150f54e0416b60c95904456cdcf379f4eb564feb7c2c7bc2b8729cad","src/agentio.rs":"bce4c3dfcfa433209a409ac0c0752f8c95ab37bb6239a42f99b83858e8747bd1","src/auth.rs":"ced1a18f691894984244088020ea25dc1ee678603317f0c7dfc8b8842fa750b4","src/cert.rs":"2a353b3230e3bd0c9ff91620a2e43c1dcaf493b1ff7997e6b51f8af589b925c1","src/constants.rs":"998e77bee88197a240032c1bfbddcff417a25ba82e576a0d2fe18ee9b63cefc7","src/ech.rs":"f67072f51dc52f7444c1983ba404b3db7366d84e9a798421d978ab244b6b57e9","src/err.rs":"8b2156f280c8823b2f9767bdd98fcf5c20ddc2e650301be005d1b96e15256f4a","src/exp.rs":"cec59d61fc95914f9703d2fb6490a8507af993c9db710dde894f2f8fd38123c7","src/ext.rs":"4b3bc6a9eb8f4d466e627281902f2385549531ea627a76d9b8d223f212c04284","src/hkdf.rs":"a53a414bc53dd080a9cb716e604aa73b81df80a8ef4f7406d54264e078e8a867","src/hp.rs":"7f98ef9b79262a3628f0bfdc6acd33d3c0ef4c20931b62c46ec0adcf2a337497","src/lib.rs":"59fbfc50f27addbdeac0dfd3e34f652eb51e2a3056ce11c587ff0da35b453843","src/once.rs":"b9850384899a1a016e839743d3489c0d4d916e1973746ef8c89872105d7d9736","src/p11.rs":"c2f70d8772c816761fb089000f1249af25754c7faf3c02dfd9e18bbfcbc6cbf6","src/prio.rs":"e5e169296c0ac69919c59fb6c1f8bd6bf079452eaa13d75da0edd41d435d3f6f","src/replay.rs":"ad019f543c36d217f7e4ec23cd46117c17aaca75d56147bfc80c286f208659d2","src/result.rs":"0587cbb6aace71a7f9765ef7c01dcd9f73a49dcc6331e1d8fe4de2aef6ca65b6","src/secrets.rs":"076b72410af797e48c528287159181acf30d5cf88c1213ad539d3446aecf7388","src/selfencrypt.rs":"6f39a62424048790e9a0b4660ed15644f09927b926b1dfa6d5e4695921d2e082","src/ssl.rs":"b16a5f154353a1cac1b5f887f25b8f934d60f9847e1e8e0e87ddaf980b64f530","src/time.rs":"88647eb712825cacf5b551e2d26abcad57b343fe3fbbaa3a94de75955247083c","tests/aead.rs":"5ee882f316c49b0217273583cb7c12396da444d7cdb60e354b40aac38fc70a63","tests/agent.rs":"101a905a1168d139d9b0a5598036eaf3e7b2c110644e01200a6a7ba0a65aa51f","tests/ext.rs":"6ad47ca33c55aa7e775b6dd4bab55144d17ac0aba3b8fdbc203ece6f11851a82","tests/handshake.rs":"d5d542203d9f322e39391fe2748b2de38ee11da1b5577cd81b179a8613e424a7","tests/hkdf.rs":"47830c1ea58a02d100522bdde6fabc02bb447ccb85affa0cdc44bc25da1be32a","tests/hp.rs":"ec8b38b5421e52bee18da3417e0e52afe270dbe2d365ba8c3956f878ea7aa2d2","tests/init.rs":"fc9e392b1efa0d8efb28952f73ffc05e5348e7b2b69207b60e375c3888a252a2","tests/selfencrypt.rs":"1125c858ec4e0a6994f34d162aa066cb003c61b324f268529ea04bcb641347cb"},"package":null}

View File

@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.65.0"
name = "neqo-crypto"
version = "0.6.7"
version = "0.6.8"
authors = ["Martin Thomson <mt@lowentropy.net>"]
build = "build.rs"
license = "MIT OR Apache-2.0"

View File

@ -540,8 +540,8 @@ impl SecretAgent {
/// Install an extension handler.
///
/// This can be called multiple times with different values for `ext`. The handler is provided as
/// Rc<RefCell<>> so that the caller is able to hold a reference to the handler and later access any
/// state that it accumulates.
/// `Rc<RefCell<dyn T>>` so that the caller is able to hold a reference to the handler and later
/// access any state that it accumulates.
///
/// # Errors
/// When the extension handler can't be successfully installed.

View File

@ -67,14 +67,14 @@ fn chacha20_ctr() {
}
#[test]
#[should_panic]
#[should_panic(expected = "out of range")]
fn aes_short() {
let hp = make_hp(TLS_AES_128_GCM_SHA256);
mem::drop(hp.mask(&[0; 15]));
}
#[test]
#[should_panic]
#[should_panic(expected = "out of range")]
fn chacha20_short() {
let hp = make_hp(TLS_CHACHA20_POLY1305_SHA256);
mem::drop(hp.mask(&[0; 15]));

View File

@ -1 +1 @@
{"files":{"Cargo.toml":"937b8c7c612a6d5908da8dceaf9f1dea0561384dca5a17dd350b80e03527535c","src/buffered_send_stream.rs":"4bc45ca03252dc34ab421a2af3499191b182a619143c61d5609a46377c9a0f3d","src/client_events.rs":"b22ab079e7a06a3c51fdd3b642c0f503ca25c6d242eb5a20cbe9c86f43a8048d","src/conn_params.rs":"409f2899475fe6dfecacf191f08ea0905b0477aebacd165424542d40bbd62991","src/connection.rs":"49745c98331acd9b9eb3bb877675e0706e150627e305c192fa9e14deb17eb81a","src/connection_client.rs":"04844490ada0f00ea09e667a1f6f03e558a9f1c9ce3f00bd9552a0beef24b952","src/connection_server.rs":"542233f40064a6deba1ed54f81570760047c158cace41a7221a79be1ead462b9","src/control_stream_local.rs":"4b0224ecced01d2fce4192c72d682c01a8486fbdb2c575e5206d3777e646c400","src/control_stream_remote.rs":"7a261ac7df77e90a428ab0f92457a934a92a8c581462fc1818efd3de0c0ebd69","src/features/extended_connect/mod.rs":"98fd04d65ebb71a327a667ff9071f007aad4015c29af43a8c25f216b76c45276","src/features/extended_connect/tests/mod.rs":"fd6aee37243713e80fc526552f21f0222338cec9890409b6575a2a637b17ec1f","src/features/extended_connect/tests/webtransport/datagrams.rs":"8ba487a3bbd75e45b9b091397d8948e98ed8f5f8bcee033d629712833794747d","src/features/extended_connect/tests/webtransport/mod.rs":"5378f8192dafcd65b61318094375d7e5a45468e97dbc25495c6ff1a527734f33","src/features/extended_connect/tests/webtransport/negotiation.rs":"f870162ddb079028900154051624863cdbfbacfbe152b6424c0f67b5d3998881","src/features/extended_connect/tests/webtransport/sessions.rs":"53a052b52006193d5e4e3f0a74144572617737de9ff3ae00be033a246088d265","src/features/extended_connect/tests/webtransport/streams.rs":"4d590c8ee46ab6bd965053572994c252182f361698f598fd29ce51a530e5d15a","src/features/extended_connect/webtransport_session.rs":"6fb5d63005a714d72e8d51093d102bdc7f8b6cb62b1533e88386a50901673559","src/features/extended_connect/webtransport_streams.rs":"747be0d9510b87b9bb301c4299d66311bb433334dbe8e3e85568cea85d4294a2","src/features/mod.rs":"a981ebbd03e7bb7ea2313e883452e44f052c48f28edb7fd53a0825911b490230","src/frames/hframe.rs":"eb7e783c4d4b9b1befc25398be3dce45c1ac253ecd40d14f9d867a1fd8c4002f","src/frames/mod.rs":"7d0a46ca147336d14781edb8dbee8b03c2e4bcd6646f5473a9d93d31fe73fecb","src/frames/reader.rs":"3d7af10a21833049aa0277caec4abe13d677d2d62526f1c83126f2defe19ee5e","src/frames/tests/hframe.rs":"33a30bb98bb512606a06ae1752e1ed9e4588b7d3f5e9439ec83bb2e779d4ac80","src/frames/tests/mod.rs":"81cac9702e9016dacd60085c2e3968093b356fe682ced33d7c9c1f3151b9201c","src/frames/tests/reader.rs":"312a3deda7b3a4bbd7afed879c94d0644fce8e34435365ef9cae1fbaa62496af","src/frames/tests/wtframe.rs":"589ebe1e62ce4da63b37b7d22cde7ba572ddbf29336fdcdbbcd0a745f79dacd8","src/frames/wtframe.rs":"e8e46257b7e58ee636965b40499fef3f154523111abbc0341882ace9ba156c1b","src/headers_checks.rs":"ff1b3beca3569e3350bcdb413b8e055eaf0548fdacbaacd66d3147f832444879","src/lib.rs":"dda89089d02c1b0b44563da29b3f402f986812fbc8c78a57a0a20b727fa04407","src/priority.rs":"6bca5851629890b9c7264608d215c71841c7305deeada3d92e8c626b25457f88","src/push_controller.rs":"aa2a64180d8cb1b87682d0d8bbc42167188e8e1890261cb4cabb76de1fcc708b","src/qlog.rs":"877d1b21d2a252b7575254f68530c887cedc71f6d73a3903d9659d90b8206c29","src/qpack_decoder_receiver.rs":"50c5e7679304b227a5f86ab681396d59c5885a8d7a4b72985cce82f3f8eaa129","src/qpack_encoder_receiver.rs":"3deca0555826167bbaf8099eb1b394883e5e5c8c4ee68261f8c4816bdf686eda","src/recv_message.rs":"1f740c59676f5913108de68f41db1dfc1b8d6feeb0467c61ae652d6d26e75682","src/request_target.rs":"9182b641f7a7b55272e0e2e872d24a35b1207f35399221b08b899857c3e873ab","src/send_message.rs":"43cac1e6d5a31fe26007035c12b45916c7a7c7d6564153b3694bf1109fd6aa01","src/server.rs":"afe2710fd2f6927a4b69286eef30f472ac8036f5ccf11f06953a8b3673dc5049","src/server_connection_events.rs":"5fc125a13d9da8be5ad2d165206990b55fff890920e723db2314580159afa5d9","src/server_events.rs":"9f685a7bf28018dcdfc773c27f84c8307221a819b2fa27805e5462bbf9aa6c19","src/settings.rs":"a47a7e84dc745ec88d9eccead786ec1a2355b33b30d988d01a2e8a7043168d98","src/stream_type_reader.rs":"cb84654c2d18e1e382d4ea6c05d29026552928eb6a7de9612e7d6d454e357f03","tests/httpconn.rs":"8b62aa9a24ccc45f436aa57ff7d5b37394d844eced6b204085fc5086b1a643c7","tests/priority.rs":"09c3203e92a711cf8d59ba2abcdaef5399c04f0330bc14860216ad707b54c13a","tests/send_message.rs":"673ae1d0bf2dce46c21ee8353f45f189d2cb64a2f6e137ae38da6b2262ad066e","tests/webtransport.rs":"053fbe155cf33c0cce1e5e8f7c7d44e8bf82d69cd419d0c8147e92555bf89575"},"package":null}
{"files":{"Cargo.toml":"5f26a2e98550f2d981392bc0d401d3673a2e59e4fceb32561062138f8c6711ea","src/buffered_send_stream.rs":"4bc45ca03252dc34ab421a2af3499191b182a619143c61d5609a46377c9a0f3d","src/client_events.rs":"b22ab079e7a06a3c51fdd3b642c0f503ca25c6d242eb5a20cbe9c86f43a8048d","src/conn_params.rs":"409f2899475fe6dfecacf191f08ea0905b0477aebacd165424542d40bbd62991","src/connection.rs":"49745c98331acd9b9eb3bb877675e0706e150627e305c192fa9e14deb17eb81a","src/connection_client.rs":"04844490ada0f00ea09e667a1f6f03e558a9f1c9ce3f00bd9552a0beef24b952","src/connection_server.rs":"542233f40064a6deba1ed54f81570760047c158cace41a7221a79be1ead462b9","src/control_stream_local.rs":"4b0224ecced01d2fce4192c72d682c01a8486fbdb2c575e5206d3777e646c400","src/control_stream_remote.rs":"7a261ac7df77e90a428ab0f92457a934a92a8c581462fc1818efd3de0c0ebd69","src/features/extended_connect/mod.rs":"98fd04d65ebb71a327a667ff9071f007aad4015c29af43a8c25f216b76c45276","src/features/extended_connect/tests/mod.rs":"fd6aee37243713e80fc526552f21f0222338cec9890409b6575a2a637b17ec1f","src/features/extended_connect/tests/webtransport/datagrams.rs":"8ba487a3bbd75e45b9b091397d8948e98ed8f5f8bcee033d629712833794747d","src/features/extended_connect/tests/webtransport/mod.rs":"5378f8192dafcd65b61318094375d7e5a45468e97dbc25495c6ff1a527734f33","src/features/extended_connect/tests/webtransport/negotiation.rs":"f870162ddb079028900154051624863cdbfbacfbe152b6424c0f67b5d3998881","src/features/extended_connect/tests/webtransport/sessions.rs":"53a052b52006193d5e4e3f0a74144572617737de9ff3ae00be033a246088d265","src/features/extended_connect/tests/webtransport/streams.rs":"4d590c8ee46ab6bd965053572994c252182f361698f598fd29ce51a530e5d15a","src/features/extended_connect/webtransport_session.rs":"6fb5d63005a714d72e8d51093d102bdc7f8b6cb62b1533e88386a50901673559","src/features/extended_connect/webtransport_streams.rs":"747be0d9510b87b9bb301c4299d66311bb433334dbe8e3e85568cea85d4294a2","src/features/mod.rs":"a981ebbd03e7bb7ea2313e883452e44f052c48f28edb7fd53a0825911b490230","src/frames/hframe.rs":"eb7e783c4d4b9b1befc25398be3dce45c1ac253ecd40d14f9d867a1fd8c4002f","src/frames/mod.rs":"7d0a46ca147336d14781edb8dbee8b03c2e4bcd6646f5473a9d93d31fe73fecb","src/frames/reader.rs":"3d7af10a21833049aa0277caec4abe13d677d2d62526f1c83126f2defe19ee5e","src/frames/tests/hframe.rs":"33a30bb98bb512606a06ae1752e1ed9e4588b7d3f5e9439ec83bb2e779d4ac80","src/frames/tests/mod.rs":"81cac9702e9016dacd60085c2e3968093b356fe682ced33d7c9c1f3151b9201c","src/frames/tests/reader.rs":"312a3deda7b3a4bbd7afed879c94d0644fce8e34435365ef9cae1fbaa62496af","src/frames/tests/wtframe.rs":"589ebe1e62ce4da63b37b7d22cde7ba572ddbf29336fdcdbbcd0a745f79dacd8","src/frames/wtframe.rs":"e8e46257b7e58ee636965b40499fef3f154523111abbc0341882ace9ba156c1b","src/headers_checks.rs":"ff1b3beca3569e3350bcdb413b8e055eaf0548fdacbaacd66d3147f832444879","src/lib.rs":"dda89089d02c1b0b44563da29b3f402f986812fbc8c78a57a0a20b727fa04407","src/priority.rs":"6bca5851629890b9c7264608d215c71841c7305deeada3d92e8c626b25457f88","src/push_controller.rs":"aa2a64180d8cb1b87682d0d8bbc42167188e8e1890261cb4cabb76de1fcc708b","src/qlog.rs":"877d1b21d2a252b7575254f68530c887cedc71f6d73a3903d9659d90b8206c29","src/qpack_decoder_receiver.rs":"50c5e7679304b227a5f86ab681396d59c5885a8d7a4b72985cce82f3f8eaa129","src/qpack_encoder_receiver.rs":"3deca0555826167bbaf8099eb1b394883e5e5c8c4ee68261f8c4816bdf686eda","src/recv_message.rs":"1f740c59676f5913108de68f41db1dfc1b8d6feeb0467c61ae652d6d26e75682","src/request_target.rs":"9182b641f7a7b55272e0e2e872d24a35b1207f35399221b08b899857c3e873ab","src/send_message.rs":"43cac1e6d5a31fe26007035c12b45916c7a7c7d6564153b3694bf1109fd6aa01","src/server.rs":"afe2710fd2f6927a4b69286eef30f472ac8036f5ccf11f06953a8b3673dc5049","src/server_connection_events.rs":"5fc125a13d9da8be5ad2d165206990b55fff890920e723db2314580159afa5d9","src/server_events.rs":"9f685a7bf28018dcdfc773c27f84c8307221a819b2fa27805e5462bbf9aa6c19","src/settings.rs":"a47a7e84dc745ec88d9eccead786ec1a2355b33b30d988d01a2e8a7043168d98","src/stream_type_reader.rs":"cb84654c2d18e1e382d4ea6c05d29026552928eb6a7de9612e7d6d454e357f03","tests/httpconn.rs":"8b62aa9a24ccc45f436aa57ff7d5b37394d844eced6b204085fc5086b1a643c7","tests/priority.rs":"09c3203e92a711cf8d59ba2abcdaef5399c04f0330bc14860216ad707b54c13a","tests/send_message.rs":"673ae1d0bf2dce46c21ee8353f45f189d2cb64a2f6e137ae38da6b2262ad066e","tests/webtransport.rs":"053fbe155cf33c0cce1e5e8f7c7d44e8bf82d69cd419d0c8147e92555bf89575"},"package":null}

View File

@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.65.0"
name = "neqo-http3"
version = "0.6.7"
version = "0.6.8"
authors = ["Dragana Damjanovic <dragana.damjano@gmail.com>"]
license = "MIT OR Apache-2.0"

View File

@ -1 +1 @@
{"files":{"Cargo.toml":"07e91536138a83a4ff2c03f628e574233256db2b41b26f848db8de13088457e1","src/decoder.rs":"04dca25dd8a8d0423da0abebb0cbe0498e9ce977616bf9b2b3cf1f460dc60585","src/decoder_instructions.rs":"2205c7635b8f0c568f6fe9a63c17028eaf8d29a9b5ac7136b6554cc7fbf35038","src/encoder.rs":"45436fecbb475f2ac0e5d3500b6e4b515e5b74f48f17789edf3e2ffb1571e1e3","src/encoder_instructions.rs":"1eb4f6eee2d9ff16f96dc5bf80dae9bc04316126f6eca933fb51dbd9218a439c","src/header_block.rs":"906e418548279057bd3cc1b6bb4b16db6cf9548d9b2552f9111a6411b5548d0e","src/huffman.rs":"3a9edaf827343ec6e43cfd50fcc0d0077287947160ae630da5c3ddaaefedd010","src/huffman_decode_helper.rs":"2970c57f052878b727c2f764490c54184f5c2608e1d6aa961c3b01509e290122","src/huffman_table.rs":"06fea766a6276ac56c7ee0326faed800a742c15fda1f33bf2513e6cc6a5e6d27","src/lib.rs":"f28baa9cd92b94a3e3c513882b857038ffb9de20369dd7a4e5776d9fcd8322a9","src/prefix.rs":"72c587c40aef4ed38cf13b2de91091d671611679be2a9da6f0b24abafaf50dc5","src/qlog.rs":"211cbc385d2ea925153397205c762ff55956d9871308cdfd29f31bb354e7dbd4","src/qpack_send_buf.rs":"bc86cce786b6c8a468aed8d436ec4a8a86b3d4a917495fff7931ba4026c36c47","src/reader.rs":"5d7d785cf2eabc92d784ec1d1f428bcee5a814a99c903688371115a546e760dc","src/static_table.rs":"fda9d5c6f38f94b0bf92d3afdf8432dce6e27e189736596e16727090c77b78ec","src/stats.rs":"624dfa3b40858c304097bb0ce5b1be1bb4d7916b1abfc222f1aa705907009730","src/table.rs":"370d76fe72273549e2bdf3efcfb83172e656b7a426c26726d85f47037a69f150"},"package":null}
{"files":{"Cargo.toml":"179c65b51b783d59b44cda97ecdaee2f2d16aacd55f27fb07e1704ad84ff46b8","src/decoder.rs":"04dca25dd8a8d0423da0abebb0cbe0498e9ce977616bf9b2b3cf1f460dc60585","src/decoder_instructions.rs":"2205c7635b8f0c568f6fe9a63c17028eaf8d29a9b5ac7136b6554cc7fbf35038","src/encoder.rs":"45436fecbb475f2ac0e5d3500b6e4b515e5b74f48f17789edf3e2ffb1571e1e3","src/encoder_instructions.rs":"1eb4f6eee2d9ff16f96dc5bf80dae9bc04316126f6eca933fb51dbd9218a439c","src/header_block.rs":"906e418548279057bd3cc1b6bb4b16db6cf9548d9b2552f9111a6411b5548d0e","src/huffman.rs":"3a9edaf827343ec6e43cfd50fcc0d0077287947160ae630da5c3ddaaefedd010","src/huffman_decode_helper.rs":"2970c57f052878b727c2f764490c54184f5c2608e1d6aa961c3b01509e290122","src/huffman_table.rs":"06fea766a6276ac56c7ee0326faed800a742c15fda1f33bf2513e6cc6a5e6d27","src/lib.rs":"f28baa9cd92b94a3e3c513882b857038ffb9de20369dd7a4e5776d9fcd8322a9","src/prefix.rs":"72c587c40aef4ed38cf13b2de91091d671611679be2a9da6f0b24abafaf50dc5","src/qlog.rs":"211cbc385d2ea925153397205c762ff55956d9871308cdfd29f31bb354e7dbd4","src/qpack_send_buf.rs":"bc86cce786b6c8a468aed8d436ec4a8a86b3d4a917495fff7931ba4026c36c47","src/reader.rs":"5d7d785cf2eabc92d784ec1d1f428bcee5a814a99c903688371115a546e760dc","src/static_table.rs":"fda9d5c6f38f94b0bf92d3afdf8432dce6e27e189736596e16727090c77b78ec","src/stats.rs":"624dfa3b40858c304097bb0ce5b1be1bb4d7916b1abfc222f1aa705907009730","src/table.rs":"370d76fe72273549e2bdf3efcfb83172e656b7a426c26726d85f47037a69f150"},"package":null}

View File

@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.65.0"
name = "neqo-qpack"
version = "0.6.7"
version = "0.6.8"
authors = ["Dragana Damjanovic <dragana.damjano@gmail.com>"]
license = "MIT OR Apache-2.0"

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.65.0"
name = "neqo-transport"
version = "0.6.7"
version = "0.6.8"
authors = [
"EKR <ekr@rtfm.com>",
"Andy Grover <agrover@mozilla.com>",

View File

@ -7,19 +7,22 @@
// Congestion control
#![deny(clippy::pedantic)]
use std::cmp::{max, min};
use std::fmt::{self, Debug, Display};
use std::time::{Duration, Instant};
use std::{
cmp::{max, min},
fmt::{self, Debug, Display},
time::{Duration, Instant},
};
use super::CongestionControl;
use crate::cc::MAX_DATAGRAM_SIZE;
use crate::packet::PacketNumber;
use crate::qlog::{self, QlogMetric};
use crate::sender::PACING_BURST_SIZE;
use crate::tracking::SentPacket;
use ::qlog::events::quic::CongestionStateUpdated;
use ::qlog::events::EventData;
use crate::{
cc::MAX_DATAGRAM_SIZE,
packet::PacketNumber,
qlog::{self, QlogMetric},
sender::PACING_BURST_SIZE,
tracking::SentPacket,
};
use ::qlog::events::{quic::CongestionStateUpdated, EventData};
use neqo_common::{const_max, const_min, qdebug, qinfo, qlog::NeqoQlog, qtrace};
pub const CWND_INITIAL_PKTS: usize = 10;
@ -111,6 +114,14 @@ pub struct ClassicCongestionControl<T> {
acked_bytes: usize,
ssthresh: usize,
recovery_start: Option<PacketNumber>,
/// `first_app_limited` indicates the packet number after which the application might be
/// underutilizing the congestion window. When underutilizing the congestion window due to not
/// sending out enough data, we SHOULD NOT increase the congestion window.[1] Packets sent
/// before this point are deemed to fully utilize the congestion window and count towards
/// increasing the congestion window.
///
/// [1]: https://datatracker.ietf.org/doc/html/rfc9002#section-7.8
first_app_limited: PacketNumber,
qlog: NeqoQlog,
}
@ -150,19 +161,7 @@ impl<T: WindowAdjustment> CongestionControl for ClassicCongestionControl<T> {
// Multi-packet version of OnPacketAckedCC
fn on_packets_acked(&mut self, acked_pkts: &[SentPacket], min_rtt: Duration, now: Instant) {
// Check whether we are app limited before acked packets are removed
// from bytes_in_flight.
let is_app_limited = self.app_limited();
qtrace!(
[self],
"limited={}, bytes_in_flight={}, cwnd={}, state={:?} pacing_burst_size={}",
is_app_limited,
self.bytes_in_flight,
self.congestion_window,
self.state,
MAX_DATAGRAM_SIZE * PACING_BURST_SIZE,
);
let mut is_app_limited = true;
let mut new_acked = 0;
for pkt in acked_pkts {
qinfo!(
@ -176,6 +175,9 @@ impl<T: WindowAdjustment> CongestionControl for ClassicCongestionControl<T> {
if !pkt.cc_outstanding() {
continue;
}
if pkt.pn < self.first_app_limited {
is_app_limited = false;
}
assert!(self.bytes_in_flight >= pkt.size);
self.bytes_in_flight -= pkt.size;
@ -323,6 +325,13 @@ impl<T: WindowAdjustment> CongestionControl for ClassicCongestionControl<T> {
if !pkt.cc_in_flight() {
return;
}
if !self.app_limited() {
// Given the current non-app-limited condition, we're fully utilizing the congestion
// window. Assume that all in-flight packets up to this one are NOT app-limited.
// However, subsequent packets might be app-limited. Set `first_app_limited` to the
// next packet number.
self.first_app_limited = pkt.pn + 1;
}
self.bytes_in_flight += pkt.size;
qinfo!(
@ -354,6 +363,7 @@ impl<T: WindowAdjustment> ClassicCongestionControl<T> {
ssthresh: usize::MAX,
recovery_start: None,
qlog: NeqoQlog::disabled(),
first_app_limited: 0,
}
}
@ -439,7 +449,11 @@ impl<T: WindowAdjustment> ClassicCongestionControl<T> {
continue;
}
if let Some(t) = start {
if p.time_sent.checked_duration_since(t).unwrap() > pc_period {
let elapsed = p
.time_sent
.checked_duration_since(t)
.expect("time is monotonic");
if elapsed > pc_period {
qinfo!([self], "persistent congestion");
self.congestion_window = CWND_MIN;
self.acked_bytes = 0;
@ -523,15 +537,21 @@ mod tests {
use super::{
ClassicCongestionControl, WindowAdjustment, CWND_INITIAL, CWND_MIN, PERSISTENT_CONG_THRESH,
};
use crate::cc::cubic::{Cubic, CUBIC_BETA_USIZE_DIVIDEND, CUBIC_BETA_USIZE_DIVISOR};
use crate::cc::new_reno::NewReno;
use crate::cc::{
CongestionControl, CongestionControlAlgorithm, CWND_INITIAL_PKTS, MAX_DATAGRAM_SIZE,
use crate::{
cc::{
classic_cc::State,
cubic::{Cubic, CUBIC_BETA_USIZE_DIVIDEND, CUBIC_BETA_USIZE_DIVISOR},
new_reno::NewReno,
CongestionControl, CongestionControlAlgorithm, CWND_INITIAL_PKTS, MAX_DATAGRAM_SIZE,
},
packet::{PacketNumber, PacketType},
tracking::SentPacket,
};
use neqo_common::qinfo;
use std::{
convert::TryFrom,
time::{Duration, Instant},
};
use crate::packet::{PacketNumber, PacketType};
use crate::tracking::SentPacket;
use std::convert::TryFrom;
use std::time::{Duration, Instant};
use test_fixture::now;
const PTO: Duration = Duration::from_millis(100);
@ -952,7 +972,7 @@ mod tests {
/// The code asserts on ordering errors.
#[test]
#[should_panic]
#[should_panic(expected = "time is monotonic")]
fn persistent_congestion_unsorted_newreno() {
let lost = make_lost(&[PERSISTENT_CONG_THRESH + 2, 1]);
assert!(!persistent_congestion_by_pto(
@ -965,7 +985,7 @@ mod tests {
/// The code asserts on ordering errors.
#[test]
#[should_panic]
#[should_panic(expected = "time is monotonic")]
fn persistent_congestion_unsorted_cubic() {
let lost = make_lost(&[PERSISTENT_CONG_THRESH + 2, 1]);
assert!(!persistent_congestion_by_pto(
@ -978,131 +998,183 @@ mod tests {
#[test]
fn app_limited_slow_start() {
const LESS_THAN_CWND_PKTS: usize = 4;
const BELOW_APP_LIMIT_PKTS: usize = 5;
const ABOVE_APP_LIMIT_PKTS: usize = BELOW_APP_LIMIT_PKTS + 1;
let mut cc = ClassicCongestionControl::new(NewReno::default());
let cwnd = cc.congestion_window;
let mut now = now();
let mut next_pn = 0;
for i in 0..CWND_INITIAL_PKTS {
let sent = SentPacket::new(
PacketType::Short,
u64::try_from(i).unwrap(), // pn
now(), // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
);
cc.on_packet_sent(&sent);
// simulate packet bursts below app_limit
for packet_burst_size in 1..=BELOW_APP_LIMIT_PKTS {
// always stay below app_limit during sent.
let mut pkts = Vec::new();
for _ in 0..packet_burst_size {
let p = SentPacket::new(
PacketType::Short,
next_pn, // pn
now, // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
);
next_pn += 1;
cc.on_packet_sent(&p);
pkts.push(p);
}
assert_eq!(cc.bytes_in_flight(), packet_burst_size * MAX_DATAGRAM_SIZE);
now += RTT;
cc.on_packets_acked(&pkts, RTT, now);
assert_eq!(cc.bytes_in_flight(), 0);
assert_eq!(cc.acked_bytes, 0);
assert_eq!(cwnd, cc.congestion_window); // CWND doesn't grow because we're app limited
}
assert_eq!(cc.bytes_in_flight(), CWND_INITIAL);
for i in 0..LESS_THAN_CWND_PKTS {
let acked = SentPacket::new(
// Fully utilize the congestion window by sending enough packets to
// have `bytes_in_flight` above the `app_limited` threshold.
let mut pkts = Vec::new();
for _ in 0..ABOVE_APP_LIMIT_PKTS {
let p = SentPacket::new(
PacketType::Short,
u64::try_from(i).unwrap(), // pn
now(), // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
next_pn, // pn
now, // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
);
cc.on_packets_acked(&[acked], RTT, now());
next_pn += 1;
cc.on_packet_sent(&p);
pkts.push(p);
}
assert_eq!(
cc.bytes_in_flight(),
ABOVE_APP_LIMIT_PKTS * MAX_DATAGRAM_SIZE
);
now += RTT;
// Check if congestion window gets increased for all packets currently in flight
for (i, pkt) in pkts.into_iter().enumerate() {
cc.on_packets_acked(&[pkt], RTT, now);
assert_eq!(
cc.bytes_in_flight(),
(CWND_INITIAL_PKTS - i - 1) * MAX_DATAGRAM_SIZE
(ABOVE_APP_LIMIT_PKTS - i - 1) * MAX_DATAGRAM_SIZE
);
assert_eq!(cc.cwnd(), (CWND_INITIAL_PKTS + i + 1) * MAX_DATAGRAM_SIZE);
}
// Now we are app limited
for i in 4..CWND_INITIAL_PKTS {
let p = [SentPacket::new(
PacketType::Short,
u64::try_from(i).unwrap(), // pn
now(), // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
)];
cc.on_packets_acked(&p, RTT, now());
assert_eq!(
cc.bytes_in_flight(),
(CWND_INITIAL_PKTS - i - 1) * MAX_DATAGRAM_SIZE
);
assert_eq!(cc.cwnd(), (CWND_INITIAL_PKTS + 4) * MAX_DATAGRAM_SIZE);
// increase acked_bytes with each packet
qinfo!("{} {}", cc.congestion_window, cwnd + i * MAX_DATAGRAM_SIZE);
assert_eq!(cc.congestion_window, cwnd + (i + 1) * MAX_DATAGRAM_SIZE);
assert_eq!(cc.acked_bytes, 0);
}
}
#[test]
fn app_limited_congestion_avoidance() {
const CWND_PKTS_CA: usize = CWND_INITIAL_PKTS / 2;
const BELOW_APP_LIMIT_PKTS: usize = CWND_PKTS_CA - 2;
const ABOVE_APP_LIMIT_PKTS: usize = BELOW_APP_LIMIT_PKTS + 1;
let mut cc = ClassicCongestionControl::new(NewReno::default());
let mut now = now();
// Change state to congestion avoidance by introducing loss.
let p_lost = SentPacket::new(
PacketType::Short,
1, // pn
now(), // time sent
now, // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
);
cc.on_packet_sent(&p_lost);
cwnd_is_default(&cc);
cc.on_packets_lost(Some(now()), None, PTO, &[p_lost]);
now += PTO;
cc.on_packets_lost(Some(now), None, PTO, &[p_lost]);
cwnd_is_halved(&cc);
let p_not_lost = SentPacket::new(
PacketType::Short,
1, // pn
now(), // time sent
2, // pn
now, // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
);
cc.on_packet_sent(&p_not_lost);
cc.on_packets_acked(&[p_not_lost], RTT, now());
now += RTT;
cc.on_packets_acked(&[p_not_lost], RTT, now);
cwnd_is_halved(&cc);
// cc is app limited therefore cwnd in not increased.
assert_eq!(cc.acked_bytes, 0);
// Now we are in the congestion avoidance state.
assert_eq!(cc.state, State::CongestionAvoidance);
// simulate packet bursts below app_limit
let mut next_pn = 3;
for packet_burst_size in 1..=BELOW_APP_LIMIT_PKTS {
// always stay below app_limit during sent.
let mut pkts = Vec::new();
for _ in 0..packet_burst_size {
let p = SentPacket::new(
PacketType::Short,
next_pn, // pn
now, // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
);
next_pn += 1;
cc.on_packet_sent(&p);
pkts.push(p);
}
assert_eq!(cc.bytes_in_flight(), packet_burst_size * MAX_DATAGRAM_SIZE);
now += RTT;
for (i, pkt) in pkts.into_iter().enumerate() {
cc.on_packets_acked(&[pkt], RTT, now);
assert_eq!(
cc.bytes_in_flight(),
(packet_burst_size - i - 1) * MAX_DATAGRAM_SIZE
);
cwnd_is_halved(&cc); // CWND doesn't grow because we're app limited
assert_eq!(cc.acked_bytes, 0);
}
}
// Fully utilize the congestion window by sending enough packets to
// have `bytes_in_flight` above the `app_limited` threshold.
let mut pkts = Vec::new();
for i in 0..CWND_PKTS_CA {
for _ in 0..ABOVE_APP_LIMIT_PKTS {
let p = SentPacket::new(
PacketType::Short,
u64::try_from(i + 3).unwrap(), // pn
now(), // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
next_pn, // pn
now, // time sent
true, // ack eliciting
Vec::new(), // tokens
MAX_DATAGRAM_SIZE, // size
);
next_pn += 1;
cc.on_packet_sent(&p);
pkts.push(p);
}
assert_eq!(cc.bytes_in_flight(), CWND_INITIAL / 2);
for i in 0..CWND_PKTS_CA - 2 {
cc.on_packets_acked(&pkts[i..=i], RTT, now());
assert_eq!(
cc.bytes_in_flight(),
ABOVE_APP_LIMIT_PKTS * MAX_DATAGRAM_SIZE
);
now += RTT;
let mut last_acked_bytes = 0;
// Check if congestion window gets increased for all packets currently in flight
for (i, pkt) in pkts.into_iter().enumerate() {
cc.on_packets_acked(&[pkt], RTT, now);
assert_eq!(
cc.bytes_in_flight(),
(CWND_PKTS_CA - i - 1) * MAX_DATAGRAM_SIZE
(ABOVE_APP_LIMIT_PKTS - i - 1) * MAX_DATAGRAM_SIZE
);
assert_eq!(cc.cwnd(), CWND_PKTS_CA * MAX_DATAGRAM_SIZE);
assert_eq!(cc.acked_bytes, MAX_DATAGRAM_SIZE * (i + 1));
}
// Now we are app limited
for i in CWND_PKTS_CA - 2..CWND_PKTS_CA {
cc.on_packets_acked(&pkts[i..=i], RTT, now());
assert_eq!(
cc.bytes_in_flight(),
(CWND_PKTS_CA - i - 1) * MAX_DATAGRAM_SIZE
);
assert_eq!(cc.cwnd(), CWND_PKTS_CA * MAX_DATAGRAM_SIZE);
assert_eq!(cc.acked_bytes, MAX_DATAGRAM_SIZE * 3);
// The cwnd doesn't increase, but the acked_bytes do, which will eventually lead to an
// increase, once the number of bytes reaches the necessary level
cwnd_is_halved(&cc);
// increase acked_bytes with each packet
assert_ne!(cc.acked_bytes, last_acked_bytes);
last_acked_bytes = cc.acked_bytes;
}
}
}

View File

@ -858,7 +858,7 @@ mod test {
remote_stream_limits(Role::Server, 0, 2);
}
#[should_panic]
#[should_panic(expected = ".is_allowed")]
#[test]
fn remote_stream_limits_asserts_if_limit_exceeded() {
let mut fc = RemoteStreamLimits::new(2, 1, Role::Client);

View File

@ -918,19 +918,19 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = "v4.is_some() || v6.is_some()")]
fn preferred_address_neither() {
_ = PreferredAddress::new(None, None);
}
#[test]
#[should_panic]
#[should_panic(expected = ".is_unspecified")]
fn preferred_address_v4_unspecified() {
_ = PreferredAddress::new(Some(SocketAddrV4::new(Ipv4Addr::from(0), 443)), None);
}
#[test]
#[should_panic]
#[should_panic(expected = "left != right")]
fn preferred_address_v4_zero_port() {
_ = PreferredAddress::new(
Some(SocketAddrV4::new(Ipv4Addr::from(0xc000_0201), 0)),
@ -939,13 +939,13 @@ mod tests {
}
#[test]
#[should_panic]
#[should_panic(expected = ".is_unspecified")]
fn preferred_address_v6_unspecified() {
_ = PreferredAddress::new(None, Some(SocketAddrV6::new(Ipv6Addr::from(0), 443, 0, 0)));
}
#[test]
#[should_panic]
#[should_panic(expected = "left != right")]
fn preferred_address_v6_zero_port() {
_ = PreferredAddress::new(None, Some(SocketAddrV6::new(Ipv6Addr::from(1), 0, 0, 0)));
}