windowsize atomicity
This commit is contained in:
parent
27f87c2645
commit
7a58c51037
@ -260,11 +260,12 @@ func (c *NewReno) receivedAck(ack uint32) {
|
||||
|
||||
c.inFlight = c.inFlight[i:]
|
||||
if c.slowStart {
|
||||
c.windowSize += uint32(i)
|
||||
atomic.AddUint32(&c.windowSize, uint32(i))
|
||||
} else {
|
||||
c.windowCount += uint32(i)
|
||||
if c.windowCount > c.windowSize {
|
||||
c.windowCount -= uint32(i)
|
||||
s := c.windowSize
|
||||
if c.windowCount > s {
|
||||
c.windowCount -= s
|
||||
atomic.AddUint32(&c.windowSize, 1)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user