Take next packet index into account when sending NACKs.

This avoids sending NACKs for packets in the future.
This commit is contained in:
Juliusz Chroboczek
2020-10-04 12:51:56 +02:00
parent 67a821ea75
commit 4a8e48d146
3 changed files with 38 additions and 21 deletions
+2 -2
View File
@@ -264,7 +264,7 @@ func TestBitmapGet(t *testing.T) {
pos := uint16(42)
for cache.bitmap != 0 {
found, first, bitmap := cache.BitmapGet()
found, first, bitmap := cache.BitmapGet(42 + 65)
if first < pos || first >= pos+64 {
t.Errorf("First is %v, pos is %v", first, pos)
}
@@ -304,7 +304,7 @@ func TestBitmapPacket(t *testing.T) {
}
}
found, first, bitmap := cache.BitmapGet()
found, first, bitmap := cache.BitmapGet(42 + 65)
if !found {
t.Fatalf("Didn't find any 0 bits")