-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fixes to the mplex implementation #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Fixed a memory leak with outgoing substreams. |
gnunicorn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Minor changes requested. Feel free to merge after having fixed them.
mplex/src/lib.rs
Outdated
| F: FnMut(&codec::Elem) -> Option<O>, | ||
| { | ||
| // If an error happened earlier, immediately return it. | ||
| match inner.error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe make it more explicit rather than having an empty match?
if let Err(ref err) = inner.error {
return Err(IoError::new(err.kind(), err.to_string()))
}| })); | ||
|
|
||
| if let Some(num) = num { | ||
| inner.opened_substreams.insert(num); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whty don't we insert this any longer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's dealt with in next_match.
|
tests failing?!? |
|
CI fails because of issues fixed by #366. |
mplex/src/lib.rs
Outdated
| error: Result<(), IoError>, | ||
| // Underlying stream. | ||
| inner: Fuse<Framed<C, codec::Codec>>, | ||
| inner: executor::Spawn<Fuse<Framed<C, codec::Codec>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain a bit what made this change and the introduction of Notifier necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I thought it was necessary for multiplexing to work correctly, then realized it was not.
|
I reverted the switch to spawning a new task, as it is indeed unnecessary. |
Substreamstruct yet, which is bad.