diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/rust/neqo-qpack | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/neqo-qpack')
-rw-r--r-- | third_party/rust/neqo-qpack/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | third_party/rust/neqo-qpack/Cargo.toml | 30 | ||||
-rw-r--r-- | third_party/rust/neqo-qpack/src/decoder.rs | 4 | ||||
-rw-r--r-- | third_party/rust/neqo-qpack/src/encoder.rs | 5 | ||||
-rw-r--r-- | third_party/rust/neqo-qpack/src/huffman.rs | 6 | ||||
-rw-r--r-- | third_party/rust/neqo-qpack/src/huffman_decode_helper.rs | 9 | ||||
-rw-r--r-- | third_party/rust/neqo-qpack/src/lib.rs | 6 | ||||
-rw-r--r-- | third_party/rust/neqo-qpack/src/qpack_send_buf.rs | 2 | ||||
-rw-r--r-- | third_party/rust/neqo-qpack/src/reader.rs | 19 | ||||
-rw-r--r-- | third_party/rust/neqo-qpack/src/table.rs | 2 |
10 files changed, 39 insertions, 46 deletions
diff --git a/third_party/rust/neqo-qpack/.cargo-checksum.json b/third_party/rust/neqo-qpack/.cargo-checksum.json index 2bbec5df43..aae0a1e594 100644 --- a/third_party/rust/neqo-qpack/.cargo-checksum.json +++ b/third_party/rust/neqo-qpack/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"2eabb2ad2846a08b51b306634ed75dc14ab3a43738b1190e3b4c4f2beb00b8e2","src/decoder.rs":"7e468d59adff1fa9373cbb703d13a7503f721a89bebafd049feaf0308a39b606","src/decoder_instructions.rs":"d991d70e51f079bc5b30d3982fd0176edfa9bb7ba14c17a20ec3eea878c56206","src/encoder.rs":"e026da38c2c3410a4e9aa330cda09ac411008772dd66d262d6c375601cebf481","src/encoder_instructions.rs":"86e3abbd9cf94332041326ac6cf806ed64623e3fd38dbc0385b1f63c37e73fd9","src/header_block.rs":"3925476df69b90d950594faadc5cb24c374d46de8c75a374a235f0d27323a7d8","src/huffman.rs":"8b0b2ea069c2a6eb6677b076b99b08ac0d29eabe1f2bbbab37f18f49187ef276","src/huffman_decode_helper.rs":"81309e27ff8f120a10c0b1598888ded21b76e297dc02cea8c7378d6a6627d62a","src/huffman_table.rs":"06fea766a6276ac56c7ee0326faed800a742c15fda1f33bf2513e6cc6a5e6d27","src/lib.rs":"196114397c2b1bf6ef154206018f519b012789cf712e89b069a7616d7278ef3a","src/prefix.rs":"fb4a9acbcf6fd3178f4474404cd3d3b131abca934f69fe14a9d744bc7e636dc5","src/qlog.rs":"e320007ea8309546b26f9c0019ab8722da80dbd38fa976233fd8ae19a0af637c","src/qpack_send_buf.rs":"14d71310c260ee15ea40a783998b507c968eef12db2892b47c689e872b5242a5","src/reader.rs":"b9a7dccd726f471fc24f1d3304f03ac0a039c0828aac7b33c927be07d395c655","src/static_table.rs":"fda9d5c6f38f94b0bf92d3afdf8432dce6e27e189736596e16727090c77b78ec","src/stats.rs":"624dfa3b40858c304097bb0ce5b1be1bb4d7916b1abfc222f1aa705907009730","src/table.rs":"05dbec6483bb24c9fc8d721b70fdfefc2df53b458488b55104147f13c386a47d"},"package":null}
\ No newline at end of file +{"files":{"Cargo.toml":"c2152600379c3961ba79e661e164630a63531744f79e082fce39cdf1cbe75ddd","src/decoder.rs":"0675444129e074e9d5d56f0d45d2eaed614c85e22cfe9f2d28cdee912c15b420","src/decoder_instructions.rs":"d991d70e51f079bc5b30d3982fd0176edfa9bb7ba14c17a20ec3eea878c56206","src/encoder.rs":"84649cbee81e050f55d7ea691ac871e072741abd8bbf96303eb2e98aa8ee0aea","src/encoder_instructions.rs":"86e3abbd9cf94332041326ac6cf806ed64623e3fd38dbc0385b1f63c37e73fd9","src/header_block.rs":"3925476df69b90d950594faadc5cb24c374d46de8c75a374a235f0d27323a7d8","src/huffman.rs":"71ec740426eee0abb6205104e504f5b97f525a76c4a5f5827b78034d28ce1876","src/huffman_decode_helper.rs":"9ce470e318b3664f58aa109bed483ab15bfd9e0b17d261ea2b609668a42a9d80","src/huffman_table.rs":"06fea766a6276ac56c7ee0326faed800a742c15fda1f33bf2513e6cc6a5e6d27","src/lib.rs":"fd673630b5ed64197851c9a9758685096d3c0aa04f4994290733a38057004ee6","src/prefix.rs":"fb4a9acbcf6fd3178f4474404cd3d3b131abca934f69fe14a9d744bc7e636dc5","src/qlog.rs":"e320007ea8309546b26f9c0019ab8722da80dbd38fa976233fd8ae19a0af637c","src/qpack_send_buf.rs":"755af90fe077b1bcca34a1a2a1bdce5ce601ea490b2ca3f1313e0107d13e67e2","src/reader.rs":"1581261741a0922b147a6975cc8b1a3503846f6dbfdb771d254760c298996982","src/static_table.rs":"fda9d5c6f38f94b0bf92d3afdf8432dce6e27e189736596e16727090c77b78ec","src/stats.rs":"624dfa3b40858c304097bb0ce5b1be1bb4d7916b1abfc222f1aa705907009730","src/table.rs":"6e16debdceadc453546f247f8316883af9eeeedd12f2070219d8484a0a131d46"},"package":null}
\ No newline at end of file diff --git a/third_party/rust/neqo-qpack/Cargo.toml b/third_party/rust/neqo-qpack/Cargo.toml index 7df63b7bf6..1becac8190 100644 --- a/third_party/rust/neqo-qpack/Cargo.toml +++ b/third_party/rust/neqo-qpack/Cargo.toml @@ -10,19 +10,20 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2018" -rust-version = "1.70.0" +edition = "2021" +rust-version = "1.74.0" name = "neqo-qpack" -version = "0.7.0" -authors = ["Dragana Damjanovic <dragana.damjano@gmail.com>"] +version = "0.7.2" +authors = ["The Neqo Authors <necko@mozilla.com>"] +homepage = "https://github.com/mozilla/neqo/" license = "MIT OR Apache-2.0" +repository = "https://github.com/mozilla/neqo/" -[dependencies] -lazy_static = "~1.4.0" -static_assertions = "~1.1.0" +[lib] +bench = false [dependencies.log] -version = "~0.4.17" +version = "0.4" default-features = false [dependencies.neqo-common] @@ -35,11 +36,16 @@ path = "./../neqo-crypto" path = "./../neqo-transport" [dependencies.qlog] -git = "https://github.com/cloudflare/quiche" -rev = "09ea4b244096a013071cfe2175bbf2945fb7f8d1" +version = "0.12" +default-features = false + +[dependencies.static_assertions] +version = "1.1" +default-features = false [dev-dependencies.test-fixture] path = "../test-fixture" -[features] -deny-warnings = [] +[lints.clippy.pedantic] +level = "warn" +priority = -1 diff --git a/third_party/rust/neqo-qpack/src/decoder.rs b/third_party/rust/neqo-qpack/src/decoder.rs index 2119db0256..b2cfb6629a 100644 --- a/third_party/rust/neqo-qpack/src/decoder.rs +++ b/third_party/rust/neqo-qpack/src/decoder.rs @@ -4,8 +4,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::convert::TryFrom; - use neqo_common::{qdebug, Header}; use neqo_transport::{Connection, StreamId}; @@ -287,7 +285,7 @@ fn map_error(err: &Error) -> Error { #[cfg(test)] mod tests { - use std::{convert::TryFrom, mem}; + use std::mem; use neqo_common::Header; use neqo_transport::{StreamId, StreamType}; diff --git a/third_party/rust/neqo-qpack/src/encoder.rs b/third_party/rust/neqo-qpack/src/encoder.rs index c7921ee2c0..c90570ccdc 100644 --- a/third_party/rust/neqo-qpack/src/encoder.rs +++ b/third_party/rust/neqo-qpack/src/encoder.rs @@ -4,10 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::{ - collections::{HashMap, HashSet, VecDeque}, - convert::TryFrom, -}; +use std::collections::{HashMap, HashSet, VecDeque}; use neqo_common::{qdebug, qerror, qlog::NeqoQlog, qtrace, Header}; use neqo_transport::{Connection, Error as TransportError, StreamId}; diff --git a/third_party/rust/neqo-qpack/src/huffman.rs b/third_party/rust/neqo-qpack/src/huffman.rs index 283a501b32..30bb880438 100644 --- a/third_party/rust/neqo-qpack/src/huffman.rs +++ b/third_party/rust/neqo-qpack/src/huffman.rs @@ -4,10 +4,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::convert::TryFrom; - use crate::{ - huffman_decode_helper::{HuffmanDecoderNode, HUFFMAN_DECODE_ROOT}, + huffman_decode_helper::{huffman_decoder_root, HuffmanDecoderNode}, huffman_table::HUFFMAN_TABLE, Error, Res, }; @@ -93,7 +91,7 @@ pub fn decode_huffman(input: &[u8]) -> Res<Vec<u8>> { } fn decode_character(reader: &mut BitReader) -> Res<Option<u16>> { - let mut node: &HuffmanDecoderNode = &HUFFMAN_DECODE_ROOT; + let mut node: &HuffmanDecoderNode = huffman_decoder_root(); let mut i = 0; while node.value.is_none() { match reader.read_bit() { diff --git a/third_party/rust/neqo-qpack/src/huffman_decode_helper.rs b/third_party/rust/neqo-qpack/src/huffman_decode_helper.rs index 122226dd1f..939312ab22 100644 --- a/third_party/rust/neqo-qpack/src/huffman_decode_helper.rs +++ b/third_party/rust/neqo-qpack/src/huffman_decode_helper.rs @@ -4,9 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::convert::TryFrom; - -use lazy_static::lazy_static; +use std::sync::OnceLock; use crate::huffman_table::HUFFMAN_TABLE; @@ -15,8 +13,9 @@ pub struct HuffmanDecoderNode { pub value: Option<u16>, } -lazy_static! { - pub static ref HUFFMAN_DECODE_ROOT: HuffmanDecoderNode = make_huffman_tree(0, 0); +pub fn huffman_decoder_root() -> &'static HuffmanDecoderNode { + static ROOT: OnceLock<HuffmanDecoderNode> = OnceLock::new(); + ROOT.get_or_init(|| make_huffman_tree(0, 0)) } fn make_huffman_tree(prefix: u32, len: u8) -> HuffmanDecoderNode { diff --git a/third_party/rust/neqo-qpack/src/lib.rs b/third_party/rust/neqo-qpack/src/lib.rs index 1581712017..10ee5df61c 100644 --- a/third_party/rust/neqo-qpack/src/lib.rs +++ b/third_party/rust/neqo-qpack/src/lib.rs @@ -4,11 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "deny-warnings", deny(warnings))] -#![warn(clippy::pedantic)] -// This is because of Encoder and Decoder structs. TODO: think about a better namings for crate and -// structs. -#![allow(clippy::module_name_repetitions)] +#![allow(clippy::module_name_repetitions)] // This lint doesn't work here. pub mod decoder; mod decoder_instructions; diff --git a/third_party/rust/neqo-qpack/src/qpack_send_buf.rs b/third_party/rust/neqo-qpack/src/qpack_send_buf.rs index a443859081..c0b8d7af1b 100644 --- a/third_party/rust/neqo-qpack/src/qpack_send_buf.rs +++ b/third_party/rust/neqo-qpack/src/qpack_send_buf.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::{convert::TryFrom, ops::Deref}; +use std::ops::Deref; use neqo_common::Encoder; diff --git a/third_party/rust/neqo-qpack/src/reader.rs b/third_party/rust/neqo-qpack/src/reader.rs index ff9c42b246..0173ed7888 100644 --- a/third_party/rust/neqo-qpack/src/reader.rs +++ b/third_party/rust/neqo-qpack/src/reader.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::{convert::TryInto, mem, str}; +use std::{mem, str}; use neqo_common::{qdebug, qerror}; use neqo_transport::{Connection, StreamId}; @@ -223,20 +223,19 @@ impl IntReader { } } -#[derive(Debug)] +#[derive(Debug, Default)] enum LiteralReaderState { + #[default] ReadHuffman, - ReadLength { reader: IntReader }, - ReadLiteral { offset: usize }, + ReadLength { + reader: IntReader, + }, + ReadLiteral { + offset: usize, + }, Done, } -impl Default for LiteralReaderState { - fn default() -> Self { - Self::ReadHuffman - } -} - /// This is decoder of a literal with a prefix: /// 1) ignores `prefix_len` bits of the first byte, /// 2) reads "huffman bit" diff --git a/third_party/rust/neqo-qpack/src/table.rs b/third_party/rust/neqo-qpack/src/table.rs index 7ce8572542..517e98db09 100644 --- a/third_party/rust/neqo-qpack/src/table.rs +++ b/third_party/rust/neqo-qpack/src/table.rs @@ -4,7 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::{collections::VecDeque, convert::TryFrom}; +use std::collections::VecDeque; use neqo_common::qtrace; |