From 8873e37bbbe1d9ce688379c23f5c671a3791e967 Mon Sep 17 00:00:00 2001 From: Cameron Bytheway Date: Wed, 9 Oct 2024 11:39:16 -0600 Subject: [PATCH] fix(s2n-quic): make AsyncWrite::poll_flush a no-op --- quic/s2n-quic/src/stream/send.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/quic/s2n-quic/src/stream/send.rs b/quic/s2n-quic/src/stream/send.rs index 66932705ae..ab35042824 100644 --- a/quic/s2n-quic/src/stream/send.rs +++ b/quic/s2n-quic/src/stream/send.rs @@ -413,10 +413,12 @@ macro_rules! impl_send_stream_trait { #[inline] fn poll_flush( - mut self: core::pin::Pin<&mut Self>, - cx: &mut core::task::Context<'_>, + self: core::pin::Pin<&mut Self>, + _cx: &mut core::task::Context<'_>, ) -> core::task::Poll<$crate::stream::Result<()>> { - Self::poll_flush(&mut self, cx) + // no-op - this contract relies on flushing intermediate buffers, not waiting for + // the peer to ACK data + core::task::Poll::Ready(Ok(())) } #[inline] @@ -476,11 +478,12 @@ macro_rules! impl_send_stream_trait { #[inline] fn poll_flush( - mut self: core::pin::Pin<&mut Self>, - cx: &mut core::task::Context<'_>, + self: core::pin::Pin<&mut Self>, + _cx: &mut core::task::Context<'_>, ) -> core::task::Poll> { - core::task::ready!($name::poll_flush(&mut self, cx))?; - Ok(()).into() + // no-op - this contract relies on flushing intermediate buffers, not waiting for + // the peer to ACK data + core::task::Poll::Ready(Ok(())) } #[inline] @@ -541,9 +544,11 @@ macro_rules! impl_send_stream_trait { #[inline] fn poll_flush( self: core::pin::Pin<&mut Self>, - cx: &mut core::task::Context<'_>, + _cx: &mut core::task::Context<'_>, ) -> core::task::Poll> { - futures::io::AsyncWrite::poll_flush(self, cx) + // no-op - this contract relies on flushing intermediate buffers, not waiting for + // the peer to ACK data + core::task::Poll::Ready(Ok(())) } #[inline]