don't count retransmission as sent bytes for connection flow control

This commit is contained in:
Marten Seemann
2016-06-16 16:05:37 +07:00
committed by Lucas Clemente
parent 8a9d70488a
commit b38d4b37fe
3 changed files with 20 additions and 2 deletions

View File

@@ -220,6 +220,20 @@ var _ = Describe("streamFrameQueue", func() {
Expect(frame).To(BeNil())
})
It("tells the FlowControlManager how many bytes it sent", func() {
queue.Push(frame1, false)
_, err := queue.Pop(1000)
Expect(err).ToNot(HaveOccurred())
Expect(queue.flowControlManager.(*mockFlowControlHandler).bytesSent).To(Equal(frame1.DataLen()))
})
It("doesn't add the bytes sent to the FlowControlManager if it was a retransmission", func() {
queue.Push(prioFrame1, true)
_, err := queue.Pop(1000)
Expect(err).ToNot(HaveOccurred())
Expect(queue.flowControlManager.(*mockFlowControlHandler).bytesSent).To(BeZero())
})
It("returns normal frames if no prio frames are available", func() {
queue.Push(frame1, false)
queue.Push(frame2, false)