dcsctp: Find out quickly if to send FORWARD-TSN

There is no need to iterate through all outstanding data chunks to know
if a FORWARD-TSN can be sent. As the FORWARD-TSN will just move the
cumulative TSN ack, if a chunk is found that is not to be expired,
there is no need to continue any further. This makes it much faster
to know if to send a FORWARD-TSN when the congestion window is large.

Bug: webrtc:12799
Change-Id: I58bce408ae9814c8d3d7bbb480b0037a2cf88dd7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219625
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34176}
This commit is contained in:
Victor Boivie 2021-05-22 23:05:19 +02:00 committed by WebRTC LUCI CQ
parent cc84c980c2
commit c48a49cd0d

View File

@ -724,11 +724,16 @@ void RetransmissionQueue::ExpireChunks(TimeMs now) {
// can be expired easily. There is always a risk that a message is expired
// that was already received by the peer, but for which there haven't been
// a SACK received. But that's acceptable, and handled.
if (item.has_expired(now)) {
if (item.is_abandoned()) {
// Already abandoned.
} else if (item.has_expired(now)) {
RTC_DLOG(LS_VERBOSE) << log_prefix_ << "Marking chunk " << *tsn.Wrap()
<< " and message " << *item.data().message_id
<< " as expired";
ExpireAllFor(item);
} else {
// A non-expired chunk. No need to iterate any further.
break;
}
}
}