-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mplex: Check for error and shutdown. (#1529)
* mplex: Check for error and shutdown. Issues #1504 and #1523 reported panics caused by polling the sink of `secio::LenPrefixCodec` after it had entered its terminal state, i.e. after it had previously encountered an error or was closed. According to the reports this happened only when using mplex as a stream multiplexer. It seems that because mplex always stores and keeps the `Waker` when polling, a wakeup of any of those wakers will resume the polling even for those cases where the previous poll did not return `Poll::Pending` but resolved to a value. To prevent polling after the connection was closed or an error happened we check for those conditions prior to every poll. * Keep error when operations fail. Co-authored-by: Pierre Krieger <[email protected]>
- Loading branch information
Showing
1 changed file
with
44 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters