Skip to content

Commit

Permalink
fix >= check for SNA
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Apr 3, 2024
1 parent ab755db commit c57fa56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions received_chunk_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// receivedChunkTracker tracks received chunks for maintaining ACK ranges
type receivedChunkTracker struct {
tsns map[uint32]struct{}
tsns map[uint32]struct{}
dupTSN []uint32
ranges []ackRange
}
Expand Down Expand Up @@ -72,7 +72,7 @@ func (q *receivedChunkTracker) push(tsn uint32, cumulativeTSN uint32) bool {
} else {
// extended element at pos, check if we can merge it with adjacent elements
if pos-1 >= 0 {
if q.ranges[pos-1].end+1 >= q.ranges[pos].start {
if q.ranges[pos-1].end+1 == q.ranges[pos].start {
q.ranges[pos-1] = ackRange{
start: q.ranges[pos-1].start,
end: q.ranges[pos].end,
Expand All @@ -85,7 +85,7 @@ func (q *receivedChunkTracker) push(tsn uint32, cumulativeTSN uint32) bool {
}
}
if pos+1 < len(q.ranges) {
if q.ranges[pos].end+1 >= q.ranges[pos+1].start {
if q.ranges[pos].end+1 == q.ranges[pos+1].start {
q.ranges[pos+1] = ackRange{
start: q.ranges[pos].start,
end: q.ranges[pos+1].end,
Expand Down

0 comments on commit c57fa56

Please sign in to comment.