don't send anti-deadlock packet after handshake confirmation

This commit is contained in:
Marten Seemann
2020-03-11 15:08:01 +07:00
parent 1f19eb0bd9
commit cdf2449785
2 changed files with 15 additions and 0 deletions

View File

@@ -126,6 +126,11 @@ func (h *sentPacketHandler) DropPackets(encLevel protocol.EncryptionLevel) {
}
func (h *sentPacketHandler) dropPackets(encLevel protocol.EncryptionLevel) {
// The server won't await address validation after the handshake is confirmed.
// This applies even if we didn't receive an ACK for a Handshake packet.
if h.perspective == protocol.PerspectiveClient && encLevel == protocol.EncryptionHandshake {
h.peerNotAwaitingAddressValidation = true
}
// remove outstanding packets from bytes_in_flight
if encLevel == protocol.EncryptionInitial || encLevel == protocol.EncryptionHandshake {
pnSpace := h.getPacketNumberSpace(encLevel)

View File

@@ -783,6 +783,16 @@ var _ = Describe("SentPacketHandler", func() {
handler.SentPacket(handshakePacketNonAckEliciting(&Packet{PacketNumber: 2}))
Expect(handler.GetLossDetectionTimeout()).To(BeZero())
})
It("doesn't send a packet to unblock the server after handshake confirmation, even if no Handshake ACK was received", func() {
handler.SentPacket(handshakePacket(&Packet{PacketNumber: 1}))
Expect(handler.GetLossDetectionTimeout()).ToNot(BeZero())
Expect(handler.OnLossDetectionTimeout()).To(Succeed())
Expect(handler.SendMode()).To(Equal(SendPTOHandshake))
// confirm the handshake
handler.DropPackets(protocol.EncryptionHandshake)
Expect(handler.GetLossDetectionTimeout()).To(BeZero())
})
})
Context("Packet-based loss detection", func() {