put STREAM frames back into the pool when they are acknowledged

This commit is contained in:
Marten Seemann 2019-09-04 20:36:45 +07:00
parent 4cfbb2f134
commit 4cb8bf3101
5 changed files with 15 additions and 8 deletions

View file

@ -786,7 +786,7 @@ var _ = Describe("Send Stream", func() {
// Acknowledge all frames.
// We don't expect the stream to be completed, since we still need to send the FIN.
for _, f := range frames {
f.OnAcked()
f.OnAcked(f.Frame)
}
// Now close the stream and acknowledge the FIN.
@ -794,7 +794,7 @@ var _ = Describe("Send Stream", func() {
frame, _ := str.popStreamFrame(protocol.MaxByteCount)
Expect(frame).ToNot(BeNil())
mockSender.EXPECT().onStreamCompleted(streamID)
frame.OnAcked()
frame.OnAcked(frame.Frame)
})
It("doesn't say it's completed when there are frames waiting to be retransmitted", func() {
@ -824,7 +824,7 @@ var _ = Describe("Send Stream", func() {
// lose the first frame, acknowledge all others
for _, f := range frames[1:] {
f.OnAcked()
f.OnAcked(f.Frame)
}
frames[0].OnLost(frames[0].Frame)
@ -832,7 +832,7 @@ var _ = Describe("Send Stream", func() {
ret, _ := str.popStreamFrame(protocol.MaxByteCount)
Expect(ret).ToNot(BeNil())
mockSender.EXPECT().onStreamCompleted(streamID)
ret.OnAcked()
ret.OnAcked(ret.Frame)
})
})
})