From cdb3b7621bb19ece71fca0d9528d9e09f4040073 Mon Sep 17 00:00:00 2001 From: Phoenix Kahlo Date: Sat, 22 Jun 2024 14:25:03 -0500 Subject: [PATCH] Fix unnecessary Incoming warning on Endpoint drop --- quinn/src/endpoint.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/quinn/src/endpoint.rs b/quinn/src/endpoint.rs index c9ad4c6d7..1f14c98a3 100644 --- a/quinn/src/endpoint.rs +++ b/quinn/src/endpoint.rs @@ -501,6 +501,14 @@ impl State { } } +impl Drop for State { + fn drop(&mut self) { + for incoming in self.recv_state.incoming.drain(..) { + self.inner.ignore(incoming); + } + } +} + fn respond(transmit: proto::Transmit, response_buffer: &[u8], socket: &dyn AsyncUdpSocket) { // Send if there's kernel buffer space; otherwise, drop it //