Skip to content

Commit

Permalink
fix(s2n-quic-dc): make TCP shutdown a no-op
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft committed Dec 4, 2024
1 parent 4e85ccb commit a541b76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions dc/s2n-quic-dc/src/stream/socket/fd/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,3 @@ where
unsafe { libc::sendmsg(fd, &msg, flags) }
} as _)
}

#[inline]
pub fn shutdown<T>(fd: &T) -> io::Result<()>
where
T: AsRawFd,
{
libc_call(|| unsafe { libc::shutdown(fd.as_raw_fd(), libc::SHUT_WR) as _ })?;
Ok(())
}
4 changes: 2 additions & 2 deletions dc/s2n-quic-dc/src/stream/socket/tokio/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
}

0 comments on commit a541b76

Please sign in to comment.