forked from quic-go/quic-go
add method to FlowControlManager to tell if Stream contribues to connection-level flow control
This commit is contained in:
committed by
Lucas Clemente
parent
ef9baf67fc
commit
1b732a4afa
@@ -171,5 +171,26 @@ var _ = Describe("Flow Control Manager", func() {
|
||||
Expect(size).To(Equal(protocol.ByteCount(0x1000)))
|
||||
})
|
||||
})
|
||||
|
||||
Context("streams contributing to connection-level flow control", func() {
|
||||
It("says that a stream contributes", func() {
|
||||
fcm.NewStream(5, true)
|
||||
contributes, err := fcm.StreamContributesToConnectionFlowControl(5)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(contributes).To(BeTrue())
|
||||
})
|
||||
|
||||
It("says that a stream doesn't contribute", func() {
|
||||
fcm.NewStream(3, false)
|
||||
contributes, err := fcm.StreamContributesToConnectionFlowControl(3)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(contributes).To(BeFalse())
|
||||
})
|
||||
|
||||
It("returns an error for an unknown stream", func() {
|
||||
_, err := fcm.StreamContributesToConnectionFlowControl(1337)
|
||||
Expect(err).To(HaveOccurred())
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user