Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone authored Feb 2, 2024
1 parent b2329f4 commit c943c78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/reliabletransport/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (ws *workersState) blockOnTryingToSend(sender *reliableSender, ticker *time
ticker.Reset(timeout.Sub(now))
scheduledNow := inflightSequence(sender.inFlight).readyToSend(now)

// if we have packets to send piggyback the ACKs
if len(scheduledNow) > 0 {
// we flush everything that is ready to be sent.
for _, p := range scheduledNow {
Expand All @@ -91,6 +92,8 @@ func (ws *workersState) blockOnTryingToSend(sender *reliableSender, ticker *time
}
return
}

// if there are no ACKs to send, our job here is done
if !sender.hasPendingACKs() {
return
}
Expand Down

0 comments on commit c943c78

Please sign in to comment.