-
Notifications
You must be signed in to change notification settings - Fork 23
fix: multistream-select negotiation on outbound substream over webrtc #465
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
base: master
Are you sure you want to change the base?
fix: multistream-select negotiation on outbound substream over webrtc #465
Conversation
…cation, modify multistream protocol message, modify opening based on str0m api changes
93e6151 to
85fae21
Compare
| protocol: protocol.to_string(), | ||
| }); | ||
|
|
||
| // self.rtc.channel(channel_id).unwrap().set_buffered_amount_low_threshold(1024); |
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.
This is an unrelated issue.
| event = self.handles.next() => match event { | ||
| None => unreachable!(), | ||
| Some((channel_id, None | Some(SubstreamEvent::Close))) => { | ||
| Some((_, None)) => {} |
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.
This is a superficial fix for another unrelated issue which I haven't investigated yet. Without this change, a "channel closed" event is fired repeatedly after a while. I believe this is caused by SubstreamHandle::tx being dropped, presumably when the substream(/channel?) is closed. The fact that the event continues firing suggests that SubstreamHandle::rx continues to be polled. Maybe the handle simply needs to be removed from self.handles?
I've also seen this happen when briefly testing with a rust-libp2p dialer, so this is not related to smoldot interop.
This PR changes how multistream-select messages received on an opening outbound substream are handled on webrtc connections. For details please see the issue description.
The PR builds on top of #441 for the str0m update. But looking at it again I realized that it also made changes to multistream-select handling. I'll look into what those are and how they relate to my changes. In any case, I believe my changes bring the implementation closer to compliance with the multistream-select spec and enable interoperability with smoldot.
fixes #464