use FlowControlManager in Stream for Reading data

This commit is contained in:
Marten Seemann
2016-06-15 19:39:50 +07:00
parent 800320ec39
commit 5d02033f0f
6 changed files with 110 additions and 128 deletions

View File

@@ -241,6 +241,15 @@ var _ = Describe("Session", func() {
Expect(session.streams[5]).To(BeNil())
})
It("informs the FlowControlManager about new streams", func() {
// since the stream doesn't yet exist, this will throw an error
err := session.flowControlManager.UpdateHighestReceived(5, 1000)
Expect(err).To(HaveOccurred())
session.newStreamImpl(5)
err = session.flowControlManager.UpdateHighestReceived(5, 2000)
Expect(err).ToNot(HaveOccurred())
})
It("ignores streams that existed previously", func() {
session.handleStreamFrame(&frames.StreamFrame{
StreamID: 5,