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:
Lucas Clemente 2017-06-06 11:18:10 +02:00
parent 5321723ef1
commit e44298a9cc
2 changed files with 13 additions and 1 deletions

View file

@ -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() {

View file

@ -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() {