Skip to content

Commit

Permalink
Take poll_close changes from rustls/tokio-rustls#42
Browse files Browse the repository at this point in the history
  • Loading branch information
jbr committed Mar 19, 2024
1 parent cb69b96 commit 02417c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,13 @@ where
while self.session.wants_write() {
ready!(self.write_io(cx))?;
}
Pin::new(&mut self.io).poll_close(cx)

Poll::Ready(match ready!(Pin::new(&mut self.io).poll_close(cx)) {
Ok(()) => Ok(()),
// When trying to shutdown, not being connected seems fine
Err(err) if err.kind() == io::ErrorKind::NotConnected => Ok(()),
Err(err) => Err(err),
})
}

fn poll_write_vectored(
Expand Down

0 comments on commit 02417c3

Please sign in to comment.