From a541b76c277a2247702fd262522f81210bb9ac2b Mon Sep 17 00:00:00 2001 From: Cameron Bytheway Date: Wed, 4 Dec 2024 11:05:24 -0700 Subject: [PATCH] fix(s2n-quic-dc): make TCP shutdown a no-op --- dc/s2n-quic-dc/src/stream/socket/fd/tcp.rs | 9 --------- dc/s2n-quic-dc/src/stream/socket/tokio/tcp.rs | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/dc/s2n-quic-dc/src/stream/socket/fd/tcp.rs b/dc/s2n-quic-dc/src/stream/socket/fd/tcp.rs index 6ecc11feff..f7a8c5a829 100644 --- a/dc/s2n-quic-dc/src/stream/socket/fd/tcp.rs +++ b/dc/s2n-quic-dc/src/stream/socket/fd/tcp.rs @@ -60,12 +60,3 @@ where unsafe { libc::sendmsg(fd, &msg, flags) } } as _) } - -#[inline] -pub fn shutdown(fd: &T) -> io::Result<()> -where - T: AsRawFd, -{ - libc_call(|| unsafe { libc::shutdown(fd.as_raw_fd(), libc::SHUT_WR) as _ })?; - Ok(()) -} diff --git a/dc/s2n-quic-dc/src/stream/socket/tokio/tcp.rs b/dc/s2n-quic-dc/src/stream/socket/tokio/tcp.rs index 983edc9160..50480ab7a7 100644 --- a/dc/s2n-quic-dc/src/stream/socket/tokio/tcp.rs +++ b/dc/s2n-quic-dc/src/stream/socket/tokio/tcp.rs @@ -138,7 +138,7 @@ impl Socket for TcpStream { #[inline] fn send_finish(&self) -> io::Result<()> { - // AsyncWrite::poll_shutdown requires a `&mut self` so we just use libc directly - tcp::shutdown(self) + // Since we authenticate socket closures, no need to also shutdown the TCP layer + Ok(()) } }