mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
enable packet pacing, for packets sent before handshake completion
It's not clear why this was disabled so far. The pacer should have some allowance for bursts, and it is expected that the handshake flights fit into this burst budget and therefore won't be delayed by the pacer. However, when using 0-RTT, it actually makes sense to start pacing right away, to avoid inducing packet loss very early in the connection.
This commit is contained in:
parent
39ae200972
commit
470ae7b39b
2 changed files with 2 additions and 1 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.handshakeComplete && !s.sentPacketHandler.HasPacingBudget() {
|
||||
if sendMode == ackhandler.SendAny && !s.sentPacketHandler.HasPacingBudget() {
|
||||
deadline := s.sentPacketHandler.TimeUntilSend()
|
||||
if deadline.IsZero() {
|
||||
deadline = deadlineSendImmediately
|
||||
|
|
|
@ -1771,6 +1771,7 @@ var _ = Describe("Connection", func() {
|
|||
sph.EXPECT().GetLossDetectionTimeout().AnyTimes()
|
||||
sph.EXPECT().SendMode().Return(ackhandler.SendAny).AnyTimes()
|
||||
sph.EXPECT().TimeUntilSend().Return(time.Now()).AnyTimes()
|
||||
sph.EXPECT().HasPacingBudget().Return(true).AnyTimes()
|
||||
gomock.InOrder(
|
||||
sph.EXPECT().SentPacket(gomock.Any()).Do(func(p *ackhandler.Packet) {
|
||||
Expect(p.EncryptionLevel).To(Equal(protocol.EncryptionInitial))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue