always call shutdown

This commit is contained in:
dignifiedquire 2020-04-08 18:53:18 +02:00
parent 56769d8b6c
commit 1e99e3453f
2 changed files with 2 additions and 0 deletions

View file

@ -343,6 +343,7 @@ impl Write for TcpStream {
}
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
self.shutdown(std::net::Shutdown::Write)?;
Pin::new(&mut &*self).poll_close(cx)
}
}

View file

@ -192,6 +192,7 @@ impl Write for UnixStream {
}
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
self.shutdown(std::net::Shutdown::Write)?;
Pin::new(&mut &*self).poll_close(cx)
}
}