merge develop into master #21
@ -147,7 +147,7 @@ func (c *NewReno) receivedSequence(seq uint32) {
|
||||
c.ackNackMu.Lock()
|
||||
defer c.ackNackMu.Unlock()
|
||||
|
||||
if !(c.ack != seq-1 && c.nack != seq-1) {
|
||||
if c.ack != seq-1 && c.nack != seq-1 {
|
||||
c.awaitingAck = append(c.awaitingAck, flightInfo{
|
||||
time: time.Now(),
|
||||
sequence: seq,
|
||||
@ -155,10 +155,8 @@ func (c *NewReno) receivedSequence(seq uint32) {
|
||||
return // if this seq doesn't change the ack field, awaitingAck will be unchanged
|
||||
}
|
||||
|
||||
c.ack = seq
|
||||
sort.Sort(c.awaitingAck)
|
||||
|
||||
a := c.ack
|
||||
a := seq
|
||||
|
||||
var i int
|
||||
var e flightInfo
|
||||
|
@ -63,6 +63,7 @@ func (n *newRenoTest) RunSideA(ctx context.Context) {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case p := <-n.aInbound:
|
||||
fmt.Printf("side A received: %d,%d,%d\n", p.seq, p.nack, p.ack)
|
||||
n.sideA.ReceivedPacket(p.seq, p.nack, p.ack)
|
||||
}
|
||||
}
|
||||
@ -75,11 +76,11 @@ func (n *newRenoTest) RunSideA(ctx context.Context) {
|
||||
}
|
||||
|
||||
seq := n.sideA.AwaitEarlyUpdate(500 * time.Millisecond)
|
||||
if seq != 0 {
|
||||
if seq == 0 { // discard keepalives
|
||||
p := congestionPacket{
|
||||
seq: seq,
|
||||
nack: n.sideA.NextAck(),
|
||||
ack: n.sideA.NextNack(),
|
||||
nack: n.sideA.NextNack(),
|
||||
ack: n.sideA.NextAck(),
|
||||
}
|
||||
n.aOutbound <- p
|
||||
}
|
||||
@ -94,6 +95,7 @@ func (n *newRenoTest) RunSideB(ctx context.Context) {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case p := <-n.bInbound:
|
||||
fmt.Printf("side B received: %d,%d,%d\n", p.seq, p.nack, p.ack)
|
||||
n.sideB.ReceivedPacket(p.seq, p.nack, p.ack)
|
||||
}
|
||||
}
|
||||
@ -106,11 +108,11 @@ func (n *newRenoTest) RunSideB(ctx context.Context) {
|
||||
}
|
||||
|
||||
seq := n.sideB.AwaitEarlyUpdate(500 * time.Millisecond)
|
||||
if seq != 0 {
|
||||
if seq == 0 { // discard keepalives
|
||||
p := congestionPacket{
|
||||
seq: seq,
|
||||
nack: n.sideB.NextAck(),
|
||||
ack: n.sideB.NextNack(),
|
||||
nack: n.sideB.NextNack(),
|
||||
ack: n.sideB.NextAck(),
|
||||
}
|
||||
n.bOutbound <- p
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user