From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- third_party/rust/neqo-http3/src/client_events.rs | 6 ++-- third_party/rust/neqo-http3/src/connection.rs | 3 -- .../rust/neqo-http3/src/connection_client.rs | 33 +++++++++------------- .../rust/neqo-http3/src/control_stream_local.rs | 5 +--- .../tests/webtransport/datagrams.rs | 2 -- .../extended_connect/tests/webtransport/mod.rs | 6 ++-- .../extended_connect/webtransport_session.rs | 20 ++----------- .../extended_connect/webtransport_streams.rs | 10 ------- third_party/rust/neqo-http3/src/frames/hframe.rs | 7 ++--- third_party/rust/neqo-http3/src/frames/reader.rs | 2 +- third_party/rust/neqo-http3/src/frames/wtframe.rs | 2 -- third_party/rust/neqo-http3/src/headers_checks.rs | 2 -- third_party/rust/neqo-http3/src/lib.rs | 29 ++++++------------- third_party/rust/neqo-http3/src/priority.rs | 8 +++++- third_party/rust/neqo-http3/src/push_controller.rs | 2 +- third_party/rust/neqo-http3/src/qlog.rs | 7 +---- third_party/rust/neqo-http3/src/recv_message.rs | 8 +----- third_party/rust/neqo-http3/src/send_message.rs | 18 ++---------- third_party/rust/neqo-http3/src/server.rs | 6 ++-- third_party/rust/neqo-http3/src/server_events.rs | 1 - 20 files changed, 49 insertions(+), 128 deletions(-) (limited to 'third_party/rust/neqo-http3/src') diff --git a/third_party/rust/neqo-http3/src/client_events.rs b/third_party/rust/neqo-http3/src/client_events.rs index 4b2ebc6c30..61aba8f9f1 100644 --- a/third_party/rust/neqo-http3/src/client_events.rs +++ b/third_party/rust/neqo-http3/src/client_events.rs @@ -61,7 +61,7 @@ pub enum Http3ClientEvent { error: AppError, local: bool, }, - /// Peer has sent a STOP_SENDING. + /// Peer has sent a `STOP_SENDING`. StopSending { stream_id: StreamId, error: AppError, @@ -83,7 +83,7 @@ pub enum Http3ClientEvent { PushDataReadable { push_id: u64 }, /// A push has been canceled. PushCanceled { push_id: u64 }, - /// A push stream was been reset due to a HttpGeneralProtocol error. + /// A push stream was been reset due to a `HttpGeneralProtocol` error. /// Most common case are malformed response headers. PushReset { push_id: u64, error: AppError }, /// New stream can be created @@ -102,7 +102,7 @@ pub enum Http3ClientEvent { GoawayReceived, /// Connection state change. StateChange(Http3State), - /// WebTransport events + /// `WebTransport` events WebTransport(WebTransportEvent), } diff --git a/third_party/rust/neqo-http3/src/connection.rs b/third_party/rust/neqo-http3/src/connection.rs index bb2b5a6ce0..287ea2c2af 100644 --- a/third_party/rust/neqo-http3/src/connection.rs +++ b/third_party/rust/neqo-http3/src/connection.rs @@ -835,9 +835,6 @@ impl Http3Connection { final_headers.push(Header::new(":protocol", conn_type.string())); } - if let Some(priority_header) = request.priority.header() { - final_headers.push(priority_header); - } final_headers.extend_from_slice(request.headers); Ok(final_headers) } diff --git a/third_party/rust/neqo-http3/src/connection_client.rs b/third_party/rust/neqo-http3/src/connection_client.rs index 5cc0541c0c..52572a760d 100644 --- a/third_party/rust/neqo-http3/src/connection_client.rs +++ b/third_party/rust/neqo-http3/src/connection_client.rs @@ -6,7 +6,6 @@ use std::{ cell::RefCell, - convert::TryFrom, fmt::{Debug, Display}, mem, net::SocketAddr, @@ -894,13 +893,6 @@ impl Http3Client { self.process_http3(now); } - /// This should not be used because it gives access to functionalities that may disrupt the - /// proper functioning of the HTTP/3 session. - /// Only used by `neqo-interop`. - pub fn conn(&mut self) -> &mut Connection { - &mut self.conn - } - /// Process HTTP3 layer. /// When `process_output`, `process_input`, or `process` is called we must call this function /// as well. The functions calls `Http3Client::check_connection_events` to handle events from @@ -943,12 +935,12 @@ impl Http3Client { /// returned. After that, the application should call the function again if a new UDP packet is /// received and processed or the timer value expires. /// - /// The HTTP/3 neqo implementation drives the HTTP/3 and QUC layers, therefore this function + /// The HTTP/3 neqo implementation drives the HTTP/3 and QUIC layers, therefore this function /// will call both layers: /// - First it calls HTTP/3 layer processing (`process_http3`) to make sure the layer writes /// data to QUIC layer or cancels streams if needed. /// - Then QUIC layer processing is called - [`Connection::process_output`][3]. This produces a - /// packet or a timer value. It may also produce ned [`ConnectionEvent`][2]s, e.g. connection + /// packet or a timer value. It may also produce new [`ConnectionEvent`][2]s, e.g. connection /// state-change event. /// - Therefore the HTTP/3 layer processing (`process_http3`) is called again. /// @@ -1296,7 +1288,7 @@ impl EventProvider for Http3Client { #[cfg(test)] mod tests { - use std::{convert::TryFrom, mem, time::Duration}; + use std::{mem, time::Duration}; use neqo_common::{event::Provider, qtrace, Datagram, Decoder, Encoder}; use neqo_crypto::{AllowZeroRtt, AntiReplay, ResumptionToken}; @@ -1306,8 +1298,9 @@ mod tests { StreamType, Version, RECV_BUFFER_SIZE, SEND_BUFFER_SIZE, }; use test_fixture::{ - addr, anti_replay, default_server_h3, fixture_init, new_server, now, - CountingConnectionIdGenerator, DEFAULT_ALPN_H3, DEFAULT_KEYS, DEFAULT_SERVER_NAME, + anti_replay, default_server_h3, fixture_init, new_server, now, + CountingConnectionIdGenerator, DEFAULT_ADDR, DEFAULT_ALPN_H3, DEFAULT_KEYS, + DEFAULT_SERVER_NAME, }; use super::{ @@ -1340,8 +1333,8 @@ mod tests { Http3Client::new( DEFAULT_SERVER_NAME, Rc::new(RefCell::new(CountingConnectionIdGenerator::default())), - addr(), - addr(), + DEFAULT_ADDR, + DEFAULT_ADDR, Http3Parameters::default() .connection_parameters( // Disable compatible upgrade, which complicates tests. @@ -1996,7 +1989,7 @@ mod tests { // The response header from PUSH_DATA (0x01, 0x06, 0x00, 0x00, 0xd9, 0x54, 0x01, 0x34) are // decoded into: fn check_push_response_header(header: &[Header]) { - let expected_push_response_header = vec![ + let expected_push_response_header = [ Header::new(":status", "200"), Header::new("content-length", "4"), ]; @@ -3952,7 +3945,7 @@ mod tests { ); } x => { - panic!("event {:?}", x); + panic!("event {x:?}"); } } @@ -3998,7 +3991,7 @@ mod tests { assert!(fin); } x => { - panic!("event {:?}", x); + panic!("event {x:?}"); } } // Stream should now be closed and gone @@ -4071,7 +4064,7 @@ mod tests { assert_eq!(stream_id, request_stream_id); } x => { - panic!("event {:?}", x); + panic!("event {x:?}"); } } } @@ -4135,7 +4128,7 @@ mod tests { assert!(!interim); recv_header = true; } else { - panic!("event {:?}", e); + panic!("event {e:?}"); } } assert!(recv_header); diff --git a/third_party/rust/neqo-http3/src/control_stream_local.rs b/third_party/rust/neqo-http3/src/control_stream_local.rs index 62676ee391..2f336c63a4 100644 --- a/third_party/rust/neqo-http3/src/control_stream_local.rs +++ b/third_party/rust/neqo-http3/src/control_stream_local.rs @@ -4,10 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::{ - collections::{HashMap, VecDeque}, - convert::TryFrom, -}; +use std::collections::{HashMap, VecDeque}; use neqo_common::{qtrace, Encoder}; use neqo_transport::{Connection, StreamId, StreamType}; diff --git a/third_party/rust/neqo-http3/src/features/extended_connect/tests/webtransport/datagrams.rs b/third_party/rust/neqo-http3/src/features/extended_connect/tests/webtransport/datagrams.rs index 1c58596dd3..27b7d2b2f2 100644 --- a/third_party/rust/neqo-http3/src/features/extended_connect/tests/webtransport/datagrams.rs +++ b/third_party/rust/neqo-http3/src/features/extended_connect/tests/webtransport/datagrams.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::Encoder; use neqo_transport::Error as TransportError; diff --git a/third_party/rust/neqo-http3/src/features/extended_connect/tests/webtransport/mod.rs b/third_party/rust/neqo-http3/src/features/extended_connect/tests/webtransport/mod.rs index 51dc47e4c1..3753c3122d 100644 --- a/third_party/rust/neqo-http3/src/features/extended_connect/tests/webtransport/mod.rs +++ b/third_party/rust/neqo-http3/src/features/extended_connect/tests/webtransport/mod.rs @@ -14,7 +14,7 @@ use neqo_common::event::Provider; use neqo_crypto::AuthenticationStatus; use neqo_transport::{ConnectionParameters, StreamId, StreamType}; use test_fixture::{ - addr, anti_replay, fixture_init, now, CountingConnectionIdGenerator, DEFAULT_ALPN_H3, + anti_replay, fixture_init, now, CountingConnectionIdGenerator, DEFAULT_ADDR, DEFAULT_ALPN_H3, DEFAULT_KEYS, DEFAULT_SERVER_NAME, }; @@ -38,8 +38,8 @@ pub fn default_http3_client(client_params: Http3Parameters) -> Http3Client { Http3Client::new( DEFAULT_SERVER_NAME, Rc::new(RefCell::new(CountingConnectionIdGenerator::default())), - addr(), - addr(), + DEFAULT_ADDR, + DEFAULT_ADDR, client_params, now(), ) diff --git a/third_party/rust/neqo-http3/src/features/extended_connect/webtransport_session.rs b/third_party/rust/neqo-http3/src/features/extended_connect/webtransport_session.rs index adbdf07e11..5e89225956 100644 --- a/third_party/rust/neqo-http3/src/features/extended_connect/webtransport_session.rs +++ b/third_party/rust/neqo-http3/src/features/extended_connect/webtransport_session.rs @@ -4,13 +4,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![allow(clippy::module_name_repetitions)] - -use std::{any::Any, cell::RefCell, collections::BTreeSet, mem, rc::Rc}; +use std::{cell::RefCell, collections::BTreeSet, mem, rc::Rc}; use neqo_common::{qtrace, Encoder, Header, MessageType, Role}; use neqo_qpack::{QPackDecoder, QPackEncoder}; -use neqo_transport::{streams::SendOrder, Connection, DatagramTracking, StreamId}; +use neqo_transport::{Connection, DatagramTracking, StreamId}; use super::{ExtendedConnectEvents, ExtendedConnectType, SessionCloseReason}; use crate::{ @@ -473,10 +471,6 @@ impl HttpRecvStream for Rc> { fn priority_update_sent(&mut self) { self.borrow_mut().priority_update_sent(); } - - fn any(&self) -> &dyn Any { - self - } } impl SendStream for Rc> { @@ -492,16 +486,6 @@ impl SendStream for Rc> { self.borrow_mut().has_data_to_send() } - fn set_sendorder(&mut self, _conn: &mut Connection, _sendorder: Option) -> Res<()> { - // Not relevant on session - Ok(()) - } - - fn set_fairness(&mut self, _conn: &mut Connection, _fairness: bool) -> Res<()> { - // Not relevant on session - Ok(()) - } - fn stream_writable(&self) {} fn done(&self) -> bool { diff --git a/third_party/rust/neqo-http3/src/features/extended_connect/webtransport_streams.rs b/third_party/rust/neqo-http3/src/features/extended_connect/webtransport_streams.rs index 84dcd20618..cdc692b8d7 100644 --- a/third_party/rust/neqo-http3/src/features/extended_connect/webtransport_streams.rs +++ b/third_party/rust/neqo-http3/src/features/extended_connect/webtransport_streams.rs @@ -215,16 +215,6 @@ impl SendStream for WebTransportSendStream { } } - fn set_sendorder(&mut self, conn: &mut Connection, sendorder: Option) -> Res<()> { - conn.stream_sendorder(self.stream_id, sendorder) - .map_err(|_| crate::Error::InvalidStreamId) - } - - fn set_fairness(&mut self, conn: &mut Connection, fairness: bool) -> Res<()> { - conn.stream_fairness(self.stream_id, fairness) - .map_err(|_| crate::Error::InvalidStreamId) - } - fn handle_stop_sending(&mut self, close_type: CloseType) { self.set_done(close_type); } diff --git a/third_party/rust/neqo-http3/src/frames/hframe.rs b/third_party/rust/neqo-http3/src/frames/hframe.rs index 83e69ba894..e69f7b449e 100644 --- a/third_party/rust/neqo-http3/src/frames/hframe.rs +++ b/third_party/rust/neqo-http3/src/frames/hframe.rs @@ -74,10 +74,7 @@ impl HFrame { Self::MaxPushId { .. } => H3_FRAME_TYPE_MAX_PUSH_ID, Self::PriorityUpdateRequest { .. } => H3_FRAME_TYPE_PRIORITY_UPDATE_REQUEST, Self::PriorityUpdatePush { .. } => H3_FRAME_TYPE_PRIORITY_UPDATE_PUSH, - Self::Grease => { - let r = random(7); - Decoder::from(&r).decode_uint(7).unwrap() * 0x1f + 0x21 - } + Self::Grease => Decoder::from(&random::<7>()).decode_uint(7).unwrap() * 0x1f + 0x21, } } @@ -120,7 +117,7 @@ impl HFrame { } Self::Grease => { // Encode some number of random bytes. - let r = random(8); + let r = random::<8>(); enc.encode_vvec(&r[1..usize::from(1 + (r[0] & 0x7))]); } Self::PriorityUpdateRequest { diff --git a/third_party/rust/neqo-http3/src/frames/reader.rs b/third_party/rust/neqo-http3/src/frames/reader.rs index 5017c666a4..1a086683cf 100644 --- a/third_party/rust/neqo-http3/src/frames/reader.rs +++ b/third_party/rust/neqo-http3/src/frames/reader.rs @@ -6,7 +6,7 @@ #![allow(clippy::module_name_repetitions)] -use std::{convert::TryFrom, fmt::Debug}; +use std::fmt::Debug; use neqo_common::{ hex_with_len, qtrace, Decoder, IncrementalDecoderBuffer, IncrementalDecoderIgnore, diff --git a/third_party/rust/neqo-http3/src/frames/wtframe.rs b/third_party/rust/neqo-http3/src/frames/wtframe.rs index deb7a026a0..20e9b81936 100644 --- a/third_party/rust/neqo-http3/src/frames/wtframe.rs +++ b/third_party/rust/neqo-http3/src/frames/wtframe.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::{Decoder, Encoder}; use crate::{frames::reader::FrameDecoder, Error, Res}; diff --git a/third_party/rust/neqo-http3/src/headers_checks.rs b/third_party/rust/neqo-http3/src/headers_checks.rs index 9bf661c8fe..2dbf43cd32 100644 --- a/third_party/rust/neqo-http3/src/headers_checks.rs +++ b/third_party/rust/neqo-http3/src/headers_checks.rs @@ -6,8 +6,6 @@ #![allow(clippy::unused_unit)] // see https://github.com/Lymia/enumset/issues/44 -use std::convert::TryFrom; - use enumset::{enum_set, EnumSet, EnumSetType}; use neqo_common::Header; diff --git a/third_party/rust/neqo-http3/src/lib.rs b/third_party/rust/neqo-http3/src/lib.rs index 635707ca7c..8272151cc1 100644 --- a/third_party/rust/neqo-http3/src/lib.rs +++ b/third_party/rust/neqo-http3/src/lib.rs @@ -4,8 +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)] +#![allow(clippy::module_name_repetitions)] // This lint doesn't work here. /*! @@ -160,7 +159,7 @@ mod server_events; mod settings; mod stream_type_reader; -use std::{any::Any, cell::RefCell, fmt::Debug, rc::Rc}; +use std::{cell::RefCell, fmt::Debug, rc::Rc}; use buffered_send_stream::BufferedStream; pub use client_events::{Http3ClientEvent, WebTransportEvent}; @@ -433,20 +432,15 @@ pub enum Http3StreamType { } #[must_use] -#[derive(PartialEq, Eq, Debug)] +#[derive(Default, PartialEq, Eq, Debug)] enum ReceiveOutput { + #[default] NoOutput, ControlFrames(Vec), UnblockedStreams(Vec), NewStream(NewStreamType), } -impl Default for ReceiveOutput { - fn default() -> Self { - Self::NoOutput - } -} - trait Stream: Debug { fn stream_type(&self) -> Http3StreamType; } @@ -509,8 +503,6 @@ trait HttpRecvStream: RecvStream { fn extended_connect_wait_for_response(&self) -> bool { false } - - fn any(&self) -> &dyn Any; } #[derive(Debug, PartialEq, Eq, Copy, Clone)] @@ -567,27 +559,25 @@ trait HttpRecvStreamEvents: RecvStreamEvents { trait SendStream: Stream { /// # Errors /// - /// Error my occur during sending data, e.g. protocol error, etc. + /// Error may occur during sending data, e.g. protocol error, etc. fn send(&mut self, conn: &mut Connection) -> Res<()>; fn has_data_to_send(&self) -> bool; fn stream_writable(&self); fn done(&self) -> bool; - fn set_sendorder(&mut self, conn: &mut Connection, sendorder: Option) -> Res<()>; - fn set_fairness(&mut self, conn: &mut Connection, fairness: bool) -> Res<()>; /// # Errors /// - /// Error my occur during sending data, e.g. protocol error, etc. + /// Error may occur during sending data, e.g. protocol error, etc. fn send_data(&mut self, _conn: &mut Connection, _buf: &[u8]) -> Res; /// # Errors /// - /// It may happen that the transport stream is already close. This is unlikely. + /// It may happen that the transport stream is already closed. This is unlikely. fn close(&mut self, conn: &mut Connection) -> Res<()>; /// # Errors /// - /// It may happen that the transport stream is already close. This is unlikely. + /// It may happen that the transport stream is already closed. This is unlikely. fn close_with_message( &mut self, _conn: &mut Connection, @@ -606,7 +596,7 @@ trait SendStream: Stream { /// # Errors /// - /// It may happen that the transport stream is already close. This is unlikely. + /// It may happen that the transport stream is already closed. This is unlikely. fn send_data_atomic(&mut self, _conn: &mut Connection, _buf: &[u8]) -> Res<()> { Err(Error::InvalidStreamId) } @@ -627,7 +617,6 @@ trait HttpSendStream: SendStream { /// This can also return an error if the underlying stream is closed. fn send_headers(&mut self, headers: &[Header], conn: &mut Connection) -> Res<()>; fn set_new_listener(&mut self, _conn_events: Box) {} - fn any(&self) -> &dyn Any; } trait SendStreamEvents: Debug { diff --git a/third_party/rust/neqo-http3/src/priority.rs b/third_party/rust/neqo-http3/src/priority.rs index f2651d3bb5..76a2cb9a85 100644 --- a/third_party/rust/neqo-http3/src/priority.rs +++ b/third_party/rust/neqo-http3/src/priority.rs @@ -1,4 +1,10 @@ -use std::{convert::TryFrom, fmt}; +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::fmt; use neqo_transport::StreamId; use sfv::{BareItem, Item, ListEntry, Parser}; diff --git a/third_party/rust/neqo-http3/src/push_controller.rs b/third_party/rust/neqo-http3/src/push_controller.rs index c4591991ae..ab6afccdf6 100644 --- a/third_party/rust/neqo-http3/src/push_controller.rs +++ b/third_party/rust/neqo-http3/src/push_controller.rs @@ -1,3 +1,4 @@ +// Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed @@ -6,7 +7,6 @@ use std::{ cell::RefCell, collections::VecDeque, - convert::TryFrom, fmt::{Debug, Display}, mem, rc::Rc, diff --git a/third_party/rust/neqo-http3/src/qlog.rs b/third_party/rust/neqo-http3/src/qlog.rs index c3a13fd19f..81f9245a3c 100644 --- a/third_party/rust/neqo-http3/src/qlog.rs +++ b/third_party/rust/neqo-http3/src/qlog.rs @@ -6,14 +6,9 @@ // Functions that handle capturing QLOG traces. -use std::convert::TryFrom; - use neqo_common::qlog::NeqoQlog; use neqo_transport::StreamId; -use qlog::{ - self, - events::{DataRecipient, EventData}, -}; +use qlog::events::{DataRecipient, EventData}; pub fn h3_data_moved_up(qlog: &mut NeqoQlog, stream_id: StreamId, amount: usize) { qlog.add_event_data(|| { diff --git a/third_party/rust/neqo-http3/src/recv_message.rs b/third_party/rust/neqo-http3/src/recv_message.rs index 36e8f65b19..be58b7e47c 100644 --- a/third_party/rust/neqo-http3/src/recv_message.rs +++ b/third_party/rust/neqo-http3/src/recv_message.rs @@ -4,9 +4,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::{ - any::Any, cell::RefCell, cmp::min, collections::VecDeque, convert::TryFrom, fmt::Debug, rc::Rc, -}; +use std::{cell::RefCell, cmp::min, collections::VecDeque, fmt::Debug, rc::Rc}; use neqo_common::{qdebug, qinfo, qtrace, Header}; use neqo_qpack::decoder::QPackDecoder; @@ -494,8 +492,4 @@ impl HttpRecvStream for RecvMessage { fn extended_connect_wait_for_response(&self) -> bool { matches!(self.state, RecvMessageState::ExtendedConnect) } - - fn any(&self) -> &dyn Any { - self - } } diff --git a/third_party/rust/neqo-http3/src/send_message.rs b/third_party/rust/neqo-http3/src/send_message.rs index 96156938a0..c50e3e056a 100644 --- a/third_party/rust/neqo-http3/src/send_message.rs +++ b/third_party/rust/neqo-http3/src/send_message.rs @@ -4,11 +4,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::{any::Any, cell::RefCell, cmp::min, fmt::Debug, rc::Rc}; +use std::{cell::RefCell, cmp::min, fmt::Debug, rc::Rc}; use neqo_common::{qdebug, qinfo, qtrace, Encoder, Header, MessageType}; use neqo_qpack::encoder::QPackEncoder; -use neqo_transport::{streams::SendOrder, Connection, StreamId}; +use neqo_transport::{Connection, StreamId}; use crate::{ frames::HFrame, @@ -270,16 +270,6 @@ impl SendStream for SendMessage { self.stream.has_buffered_data() } - fn set_sendorder(&mut self, _conn: &mut Connection, _sendorder: Option) -> Res<()> { - // Not relevant for SendMessage - Ok(()) - } - - fn set_fairness(&mut self, _conn: &mut Connection, _fairness: bool) -> Res<()> { - // Not relevant for SendMessage - Ok(()) - } - fn close(&mut self, conn: &mut Connection) -> Res<()> { self.state.fin()?; if !self.stream.has_buffered_data() { @@ -332,10 +322,6 @@ impl HttpSendStream for SendMessage { self.stream_type = Http3StreamType::ExtendedConnect; self.conn_events = conn_events; } - - fn any(&self) -> &dyn Any { - self - } } impl ::std::fmt::Display for SendMessage { diff --git a/third_party/rust/neqo-http3/src/server.rs b/third_party/rust/neqo-http3/src/server.rs index b29f715451..1396a4e4cf 100644 --- a/third_party/rust/neqo-http3/src/server.rs +++ b/third_party/rust/neqo-http3/src/server.rs @@ -151,7 +151,7 @@ impl Http3Server { active_conns.dedup(); active_conns .iter() - .for_each(|conn| self.server.add_to_waiting(conn.clone())); + .for_each(|conn| self.server.add_to_waiting(conn)); for mut conn in active_conns { self.process_events(&mut conn, now); } @@ -1271,11 +1271,11 @@ mod tests { while let Some(event) = hconn.next_event() { match event { Http3ServerEvent::Headers { stream, .. } => { - assert!(requests.get(&stream).is_none()); + assert!(!requests.contains_key(&stream)); requests.insert(stream, 0); } Http3ServerEvent::Data { stream, .. } => { - assert!(requests.get(&stream).is_some()); + assert!(requests.contains_key(&stream)); } Http3ServerEvent::DataWritable { .. } | Http3ServerEvent::StreamReset { .. } diff --git a/third_party/rust/neqo-http3/src/server_events.rs b/third_party/rust/neqo-http3/src/server_events.rs index 4be48363df..a85ece0bfb 100644 --- a/third_party/rust/neqo-http3/src/server_events.rs +++ b/third_party/rust/neqo-http3/src/server_events.rs @@ -9,7 +9,6 @@ use std::{ cell::RefCell, collections::VecDeque, - convert::TryFrom, ops::{Deref, DerefMut}, rc::Rc, }; -- cgit v1.2.3