forked from quic-go/quic-go
Always send retransmissions, irrespective of congestion state
This should probably only apply to RTOs, but we currently don't have a signal to distinguish them in the queue.
This commit is contained in:
@@ -333,7 +333,11 @@ func (h *sentPacketHandler) SendingAllowed() bool {
|
||||
h.bytesInFlight,
|
||||
h.congestion.GetCongestionWindow())
|
||||
}
|
||||
return !(congestionLimited || maxTrackedLimited)
|
||||
// Workaround for #555:
|
||||
// Always allow sending of retransmissions. This should probably be limited
|
||||
// to RTOs, but we currently don't have a nice way of distinguishing them.
|
||||
haveRetransmissions := len(h.retransmissionQueue) > 0
|
||||
return !maxTrackedLimited && (!congestionLimited || haveRetransmissions)
|
||||
}
|
||||
|
||||
func (h *sentPacketHandler) retransmitOldestTwoPackets() {
|
||||
|
||||
@@ -678,6 +678,14 @@ var _ = Describe("SentPacketHandler", func() {
|
||||
handler.retransmissionQueue = make([]*Packet, protocol.MaxTrackedSentPackets)
|
||||
Expect(handler.SendingAllowed()).To(BeFalse())
|
||||
})
|
||||
|
||||
It("allows sending if there are retransmisisons outstanding", func() {
|
||||
err := handler.SentPacket(&Packet{PacketNumber: 1, Frames: []frames.Frame{}, Length: protocol.DefaultTCPMSS + 1})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(handler.SendingAllowed()).To(BeFalse())
|
||||
handler.retransmissionQueue = []*Packet{nil}
|
||||
Expect(handler.SendingAllowed()).To(BeTrue())
|
||||
})
|
||||
})
|
||||
|
||||
Context("calculating RTO", func() {
|
||||
|
||||
Reference in New Issue
Block a user