merge develop into master #21
@ -130,14 +130,15 @@ func (c *NewReno) AwaitEarlyUpdate(keepalive time.Duration) uint32 {
|
||||
|
||||
c.checkNack()
|
||||
|
||||
// CASE 1: waiting ACKs or NACKs and no message sent in the last RTT
|
||||
if ((c.lastAck != c.ack) || (c.lastNack != c.nack)) && time.Now().After(c.lastSent.Add(rtt)) {
|
||||
return 0
|
||||
// CASE 1: waiting ACKs or NACKs and no message sent in the last half-RTT
|
||||
// this targets arrival in 0.5+0.5 ± 0.5 RTTs (1±0.5 RTTs)
|
||||
if ((c.lastAck != c.ack) || (c.lastNack != c.nack)) && time.Now().After(c.lastSent.Add(rtt / 2)) {
|
||||
return 0 // no ack needed
|
||||
}
|
||||
|
||||
// CASE 3: No message sent within the keepalive time
|
||||
// CASE 2: No message sent within the keepalive time
|
||||
if keepalive != 0 && time.Now().After(c.lastSent.Add(keepalive)) {
|
||||
return c.Sequence()
|
||||
return c.Sequence() // require an ack
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user