Skip to content

Conversation

@tomaka
Copy link
Member

@tomaka tomaka commented Jul 23, 2018

  • Right now we ignore data packets of substreams for which we haven't built a Substream struct yet, which is bad.
  • Added logging.
  • Correctly report EOF if the substream was closed.

@tomaka
Copy link
Member Author

tomaka commented Jul 28, 2018

Fixed a memory leak with outgoing substreams.

Copy link
Contributor

@gnunicorn gnunicorn left a 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 {
Copy link
Contributor

@gnunicorn gnunicorn Jul 30, 2018

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);
Copy link
Contributor

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?

Copy link
Member Author

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.

@gnunicorn
Copy link
Contributor

tests failing?!?

@tomaka
Copy link
Member Author

tomaka commented Aug 3, 2018

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>>>,
Copy link
Contributor

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?

Copy link
Member Author

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.

@tomaka
Copy link
Member Author

tomaka commented Aug 13, 2018

I reverted the switch to spawning a new task, as it is indeed unnecessary.

@gnunicorn gnunicorn merged commit b673209 into libp2p:master Aug 13, 2018
@ghost ghost removed the in progress label Aug 13, 2018
@tomaka tomaka deleted the mplex-fixes branch August 13, 2018 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants