Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Jan 31, 2024
1 parent cc4f35f commit bddbfe4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/reliabletransport/packets.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ func newInFlightPacket(p *model.Packet) *inFlightPacket {
}
}

/*
func (p *inFlightPacket) ExtractACKs() []model.PacketID {
return p.packet.ACKs
}
*/

// ACKForHigherPacket increments the number of acks received for a higher pid than this packet. This will influence the fast rexmit selection algorithm.
func (p *inFlightPacket) ACKForHigherPacket() {
Expand Down
29 changes: 29 additions & 0 deletions internal/reliabletransport/packets_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package reliabletransport

import (
"testing"
"time"
)

func Test_inFlightPacket_backoff(t *testing.T) {
type fields struct {
retries uint8
}
tests := []struct {
name string
fields fields
want time.Duration
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
p := &inFlightPacket{
retries: tt.fields.retries,
}
if got := p.backoff(); got != tt.want {
t.Errorf("inFlightPacket.backoff() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit bddbfe4

Please sign in to comment.