Skip to content

Commit

Permalink
fix(s2n-quic): make AsyncWrite::poll_flush a no-op
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft committed Oct 9, 2024
1 parent 032f326 commit 8873e37
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions quic/s2n-quic/src/stream/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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<std::io::Result<()>> {
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]
Expand Down Expand Up @@ -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<std::io::Result<()>> {
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]
Expand Down

0 comments on commit 8873e37

Please sign in to comment.