diff --git a/udt/congestion_native.go b/udt/congestion_native.go index 44847aa..ff93a17 100644 --- a/udt/congestion_native.go +++ b/udt/congestion_native.go @@ -87,7 +87,6 @@ func (ncc *NativeCongestionControl) OnACK(parms CongestionControlParms, ack pack } if ncc.loss { ncc.loss = false - parms.SetCongestionWindowSize(cWndSize) return } /* @@ -189,14 +188,12 @@ func (ncc *NativeCongestionControl) OnNAK(parms CongestionControlParms, losslist ncc.nakCount++ if ncc.decRandom != 0 && ncc.nakCount%ncc.decRandom != 0 { ncc.decCount++ + // 0.875^5 = 0.51, rate should not be decreased by more than half within a congestion period + parms.SetPacketSendPeriod(pktSendPeriod * 1125 / 1000) + ncc.lastDecSeq = parms.GetSndCurrSeqNo() return } } - ncc.decCount++ - - // 0.875^5 = 0.51, rate should not be decreased by more than half within a congestion period - parms.SetPacketSendPeriod(pktSendPeriod * 1125 / 1000) - ncc.lastDecSeq = parms.GetSndCurrSeqNo() } }