Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/proto/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,13 @@ where
State::Closing(reason, initiator) => {
tracing::trace!("connection closing after flush");
// Flush/shutdown the codec
ready!(self.codec.shutdown(cx))?;
if let Err(e) = ready!(self.codec.shutdown(cx)) {
// If the error kind is NotConnected then ignore that
// since it means the connection is already shutdown.
if e.kind() != io::ErrorKind::NotConnected {
return Poll::Ready(Err(e.into()));
}
}

// Transition the state to error
self.inner.state = State::Closed(reason, initiator);
Expand Down