fix(sctp): correct PR-SCTP max_retransmits abandonment condition#78
Open
nightness wants to merge 1 commit intowebrtc-rs:masterfrom
Open
fix(sctp): correct PR-SCTP max_retransmits abandonment condition#78nightness wants to merge 1 commit intowebrtc-rs:masterfrom
nightness wants to merge 1 commit intowebrtc-rs:masterfrom
Conversation
…→ >) Fixes webrtc-rs/webrtc#776. RFC 3758 §5.3.1 specifies that a DATA chunk should be abandoned when it has been transmitted MORE THAN max_retransmits times. The previous check used `>=`, which abandoned chunks after only max_retransmits sends (one fewer than the allowed total of max_retransmits + 1). For example, with max_retransmits=1 (reliability_value=1): Before: abandon when nsent >= 1 → abandoned after first send (zero retransmits) After: abandon when nsent > 1 → abandoned after second send (one retransmit) ✓ With max_retransmits=0 (reliability_value=0), the behavior is identical (nsent=1 satisfies both >= 0 and > 0 after the first send). Premature abandonment was the root cause of channels unexpectedly closing: the abandoned chunk triggered Forward TSN skip-ahead, which in some browser interop scenarios caused the peer to reset the stream. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a one-off error in the PR-SCTP partial reliability abandonment check (closes webrtc-rs/webrtc#776).
>= max_retransmitsto> max_retransmitsso a stream configured withmax_retransmits(0)abandons the message only after the first failed delivery attempt, not immediately on the first attempt. Previously amax_retransmits(0)DataChannel would close after a single failed send even though it should remain open.Test plan
cargo test -p rtcpassesmax_retransmits(0)stays open after one failed delivery