Skip to content

Commit

Permalink
Ignore NotConnected error in poll_shutdown()
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Feb 29, 2024
1 parent ff32e1e commit cf32e6c
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 @@ -335,7 +335,13 @@ where
while self.session.wants_write() {
ready!(self.write_io(cx))?;
}
Pin::new(&mut self.io).poll_shutdown(cx)

Poll::Ready(match ready!(Pin::new(&mut self.io).poll_shutdown(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),
})
}
}

Expand Down

0 comments on commit cf32e6c

Please sign in to comment.