From 172d0257d4f0a4a7beda62b44951d76e64cb367a Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Wed, 3 Apr 2024 15:23:50 -0400 Subject: [PATCH] Toggle the ZeroChecksum heuristics Toggle every 3 packets in cases of heavy packet loss to allow Association to recover --- association.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/association.go b/association.go index f09c03f2..bd79b882 100644 --- a/association.go +++ b/association.go @@ -2556,9 +2556,9 @@ func (a *Association) onRetransmissionTimeout(id int, nRtos uint) { defer a.lock.Unlock() // TSN hasn't been incremented in 3 attempts. Speculatively - // disable ZeroChecksum because old Pion versions had a broken implementation - if a.cumulativeTSNAckPoint+1 == a.initialTSN && nRtos == 3 { - a.sendZeroChecksum = false + // toggle ZeroChecksum because old Pion versions had a broken implementation + if a.cumulativeTSNAckPoint+1 == a.initialTSN && nRtos%3 == 0 { + a.sendZeroChecksum = !a.sendZeroChecksum } if id == timerT1Init {