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 c943c78 commit 8301d6d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions internal/reliabletransport/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (ws *workersState) blockOnTryingToSend(sender *reliableSender, ticker *time
now := time.Now()
timeout := inflightSequence(sender.inFlight).nearestDeadlineTo(now)
ticker.Reset(timeout.Sub(now))
// figure out whether we need to send any packet here
scheduledNow := inflightSequence(sender.inFlight).readyToSend(now)

// if we have packets to send piggyback the ACKs
Expand Down Expand Up @@ -98,16 +99,7 @@ func (ws *workersState) blockOnTryingToSend(sender *reliableSender, ticker *time
return
}

// special case, we want to send the clientHello as soon as possible -----------------------------
// (TODO: coordinate this with hardReset)

/*
// TODO is this doing the right thing?
if sender.pendingACKsToSend.Len() == 1 && *sender.pendingACKsToSend.first() == model.PacketID(0) {
continue
}
*/

// All packets are inflight but we still owe ACKs to the peer.
ws.logger.Debugf("Creating ACK: %d pending to ack", sender.pendingACKsToSend.Len())

ACK, err := ws.sessionManager.NewACKForPacketIDs(sender.NextPacketIDsToACK())
Expand Down

0 comments on commit 8301d6d

Please sign in to comment.