From 106d44b1f7417f12aba5970d85413d259691bac9 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Fri, 8 Dec 2023 13:30:58 -0800 Subject: [PATCH] Take the whole Packet structure in process_payload --- quinn-proto/src/connection/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index 8a115b834..8530632e5 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -2190,9 +2190,7 @@ impl Connection { let state = match self.state { State::Established => { match packet.header.space() { - SpaceId::Data => { - self.process_payload(now, remote, number.unwrap(), packet.payload.freeze())? - } + SpaceId::Data => self.process_payload(now, remote, number.unwrap(), packet)?, _ => self.process_early_payload(now, packet)?, } return Ok(()); @@ -2412,7 +2410,7 @@ impl Connection { ty: LongType::ZeroRtt, .. } => { - self.process_payload(now, remote, number.unwrap(), packet.payload.freeze())?; + self.process_payload(now, remote, number.unwrap(), packet)?; Ok(()) } Header::VersionNegotiate { .. } => { @@ -2498,8 +2496,9 @@ impl Connection { now: Instant, remote: SocketAddr, number: u64, - payload: Bytes, + packet: Packet, ) -> Result<(), TransportError> { + let payload = packet.payload.freeze(); let is_0rtt = self.spaces[SpaceId::Data].crypto.is_none(); let mut is_probing_packet = true; let mut close = None;