dcsctp: Clarify current behavior of stream reset

RFC8831, section 6.7 states that closing a data channel MUST be signaled
as resetting an outgoing stream, and that will ensure that all messages
are either delivered or abandoned before the stream is reset. In the
current implementation, dcSCTP has opted to abandoned any queued
messages that haven't been partially sent.

And this CL simply adds more documentation around this choice. It's
subject to change and a client implementation shouldn't depend on any
such behavior as the RFC allows the implementation to decide.

Bug: None
Change-Id: I60305fe396a6a3f494d823c71e092acfeb6075b7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257167
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36395}
This commit is contained in:
Victor Boivie
2022-03-18 09:38:48 +01:00
committed by WebRTC LUCI CQ
parent d7e5cfb3cf
commit fbf0ac0ecd

View File

@ -234,12 +234,19 @@ bool RRSendQueue::OutgoingStream::Discard(IsUnordered unordered,
void RRSendQueue::OutgoingStream::Pause() {
is_paused_ = true;
// https://datatracker.ietf.org/doc/html/rfc8831#section-6.7
// "Closing of a data channel MUST be signaled by resetting the corresponding
// outgoing streams [RFC6525]. This means that if one side decides to close
// the data channel, it resets the corresponding outgoing stream."
// ... "[RFC6525] also guarantees that all the messages are delivered (or
// abandoned) before the stream is reset."
// A stream is paused when it's about to be reset. In this implementation,
// it will throw away all non-partially send messages. This is subject to
// change. It will however not discard any partially sent messages - only
// whole messages. Partially delivered messages (at the time of receiving a
// Stream Reset command) will always deliver all the fragments before
// actually resetting the stream.
// it will throw away all non-partially send messages - they will be abandoned
// as noted above. This is subject to change. It will however not discard any
// partially sent messages - only whole messages. Partially delivered messages
// (at the time of receiving a Stream Reset command) will always deliver all
// the fragments before actually resetting the stream.
for (auto it = items_.begin(); it != items_.end();) {
if (it->remaining_offset == 0) {
buffered_amount_.Decrease(it->remaining_size);