mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
simplify pacing logic by introducing a SendPacingLimited send mode
This commit is contained in:
parent
470ae7b39b
commit
9d70bc24a5
8 changed files with 28 additions and 47 deletions
|
@ -1739,7 +1739,7 @@ func (s *connection) sendPackets() error {
|
|||
var sentPacket bool // only used in for packets sent in send mode SendAny
|
||||
for {
|
||||
sendMode := s.sentPacketHandler.SendMode()
|
||||
if sendMode == ackhandler.SendAny && !s.sentPacketHandler.HasPacingBudget() {
|
||||
if sendMode == ackhandler.SendPacingLimited {
|
||||
deadline := s.sentPacketHandler.TimeUntilSend()
|
||||
if deadline.IsZero() {
|
||||
deadline = deadlineSendImmediately
|
||||
|
@ -1753,6 +1753,7 @@ func (s *connection) sendPackets() error {
|
|||
}
|
||||
sendMode = ackhandler.SendAck
|
||||
}
|
||||
//nolint:exhaustive // No need to handle pacing limited here.
|
||||
switch sendMode {
|
||||
case ackhandler.SendNone:
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue