dcsctp: Support unlimited max_retransmissions
The restart limit for timers can already be limitless, but the RetransmissionErrorCounter didn't support this. With this change, the max_retransmissions and max_init_retransmits can be absl::nullopt to indicate that there should be infinite retries. Bug: webrtc:13129 Change-Id: Ia6e91cccbc2e1bb77b3fdd7f37436290adc2f483 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230701 Reviewed-by: Florent Castelli <orphis@webrtc.org> Commit-Queue: Victor Boivie <boivie@webrtc.org> Cr-Commit-Position: refs/heads/main@{#34882}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
4281208fbd
commit
9680d29e8d
@ -487,7 +487,7 @@ TEST_F(DcSctpSocketTest, ResendingInitTooManyTimesAborts) {
|
||||
SctpPacket::Parse(cb_a_.ConsumeSentPacket()));
|
||||
EXPECT_EQ(init_packet.descriptors()[0].type, InitChunk::kType);
|
||||
|
||||
for (int i = 0; i < options_.max_init_retransmits; ++i) {
|
||||
for (int i = 0; i < *options_.max_init_retransmits; ++i) {
|
||||
AdvanceTime(options_.t1_init_timeout * (1 << i));
|
||||
RunTimers();
|
||||
|
||||
@ -498,7 +498,7 @@ TEST_F(DcSctpSocketTest, ResendingInitTooManyTimesAborts) {
|
||||
}
|
||||
|
||||
// Another timeout, after the max init retransmits.
|
||||
AdvanceTime(options_.t1_init_timeout * (1 << options_.max_init_retransmits));
|
||||
AdvanceTime(options_.t1_init_timeout * (1 << *options_.max_init_retransmits));
|
||||
EXPECT_CALL(cb_a_, OnAborted).Times(1);
|
||||
RunTimers();
|
||||
|
||||
@ -543,7 +543,7 @@ TEST_F(DcSctpSocketTest, ResendingCookieEchoTooManyTimesAborts) {
|
||||
SctpPacket::Parse(cb_a_.ConsumeSentPacket()));
|
||||
EXPECT_EQ(init_packet.descriptors()[0].type, CookieEchoChunk::kType);
|
||||
|
||||
for (int i = 0; i < options_.max_init_retransmits; ++i) {
|
||||
for (int i = 0; i < *options_.max_init_retransmits; ++i) {
|
||||
AdvanceTime(options_.t1_cookie_timeout * (1 << i));
|
||||
RunTimers();
|
||||
|
||||
@ -555,7 +555,7 @@ TEST_F(DcSctpSocketTest, ResendingCookieEchoTooManyTimesAborts) {
|
||||
|
||||
// Another timeout, after the max init retransmits.
|
||||
AdvanceTime(options_.t1_cookie_timeout *
|
||||
(1 << options_.max_init_retransmits));
|
||||
(1 << *options_.max_init_retransmits));
|
||||
EXPECT_CALL(cb_a_, OnAborted).Times(1);
|
||||
RunTimers();
|
||||
|
||||
@ -647,7 +647,7 @@ TEST_F(DcSctpSocketTest, ShutdownTimerExpiresTooManyTimeClosesConnection) {
|
||||
|
||||
EXPECT_EQ(sock_a_.state(), SocketState::kShuttingDown);
|
||||
|
||||
for (int i = 0; i < options_.max_retransmissions; ++i) {
|
||||
for (int i = 0; i < *options_.max_retransmissions; ++i) {
|
||||
AdvanceTime(DurationMs(options_.rto_initial * (1 << i)));
|
||||
RunTimers();
|
||||
|
||||
@ -658,7 +658,7 @@ TEST_F(DcSctpSocketTest, ShutdownTimerExpiresTooManyTimeClosesConnection) {
|
||||
EXPECT_TRUE(cb_a_.ConsumeSentPacket().empty());
|
||||
}
|
||||
// The last expiry, makes it abort the connection.
|
||||
AdvanceTime(options_.rto_initial * (1 << options_.max_retransmissions));
|
||||
AdvanceTime(options_.rto_initial * (1 << *options_.max_retransmissions));
|
||||
EXPECT_CALL(cb_a_, OnAborted).Times(1);
|
||||
RunTimers();
|
||||
|
||||
@ -795,7 +795,7 @@ TEST_F(DcSctpSocketTest, CloseConnectionAfterTooManyLostHeartbeats) {
|
||||
|
||||
DurationMs time_to_next_hearbeat = options_.heartbeat_interval;
|
||||
|
||||
for (int i = 0; i < options_.max_retransmissions; ++i) {
|
||||
for (int i = 0; i < *options_.max_retransmissions; ++i) {
|
||||
RTC_LOG(LS_INFO) << "Letting HEARTBEAT interval timer expire - sending...";
|
||||
AdvanceTime(time_to_next_hearbeat);
|
||||
RunTimers();
|
||||
@ -834,7 +834,7 @@ TEST_F(DcSctpSocketTest, RecoversAfterASuccessfulAck) {
|
||||
|
||||
DurationMs time_to_next_hearbeat = options_.heartbeat_interval;
|
||||
|
||||
for (int i = 0; i < options_.max_retransmissions; ++i) {
|
||||
for (int i = 0; i < *options_.max_retransmissions; ++i) {
|
||||
AdvanceTime(time_to_next_hearbeat);
|
||||
RunTimers();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user