merge develop into master #21

Merged
JakeHillion merged 149 commits from develop into master 2021-05-12 00:22:59 +01:00
2 changed files with 16 additions and 14 deletions
Showing only changes of commit 8c74a7c180 - Show all commits

View File

@ -203,7 +203,7 @@ func (c *NewReno) AwaitEarlyUpdate(keepalive time.Duration) uint32 {
c.updateAckNack()
// CASE 1: > 5 waiting ACKs or any waiting 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)) {
if ((c.lastAck != c.ack) || (c.lastNack != c.nack)) && time.Now().After(c.lastSent.Add(rtt)) {
return 0
}

View File

@ -1,6 +1,9 @@
package congestion
import "time"
import (
"fmt"
"time"
)
type None struct {
sequence chan uint32
@ -27,17 +30,16 @@ func NewNone() *None {
return &c
}
func (c *None) Sequence() uint32 {
return <-c.sequence
func (c *None) String() string {
return fmt.Sprintf("{None}")
}
func (c *None) ReceivedPacket(uint32) {}
func (c *None) ReceivedAck(uint32) {}
func (c *None) NextAck() uint32 { return 0 }
func (c *None) ReceivedNack(uint32) {}
func (c *None) NextNack() uint32 { return 0 }
func (c *None) AwaitEarlyUpdate(time.Duration) uint32 {
select {}
}
func (c *None) AwaitAck(time.Duration) bool { return true }
func (c *None) Reset() {}
func (c *None) ReceivedPacket(uint32) {}
func (c *None) ReceivedAck(uint32) {}
func (c *None) ReceivedNack(uint32) {}
func (c *None) Reset() {}
func (c *None) AwaitAck(time.Duration) bool { return true }
func (c *None) NextNack() uint32 { return 0 }
func (c *None) NextAck() uint32 { return 0 }
func (c *None) AwaitEarlyUpdate(time.Duration) uint32 { select {} }
func (c *None) Sequence() uint32 { return <-c.sequence }