Skip to content

Commit fd3724e

Browse files
committed
Ignore NotConnected error in poll_shutdown()
1 parent 0587801 commit fd3724e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/common/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,13 @@ where
301301
while self.session.wants_write() {
302302
ready!(self.write_io(cx))?;
303303
}
304-
Pin::new(&mut self.io).poll_shutdown(cx)
304+
305+
Poll::Ready(match ready!(Pin::new(&mut self.io).poll_shutdown(cx)) {
306+
Ok(()) => Ok(()),
307+
// When trying to shutdown, not being connected seems fine
308+
Err(err) if err.kind() == io::ErrorKind::NotConnected => Ok(()),
309+
Err(err) => Err(err),
310+
})
305311
}
306312
}
307313

0 commit comments

Comments
 (0)