set if a stream contributes to connection flow control

This depends on the version. In gQUIC, stream 1 and 3 don't contribute,
in IETF QUIC only stream 0 doesn't contribute.
This commit is contained in:
Marten Seemann
2017-11-01 14:32:03 +07:00
parent f662822486
commit 1f644debd4
3 changed files with 27 additions and 6 deletions

View File

@@ -52,6 +52,21 @@ var _ = Describe("Version", func() {
Expect(VersionTLS.CryptoStreamID()).To(Equal(StreamID(0)))
})
It("says if a stream contributes to connection-level flowcontrol, for gQUIC", func() {
Expect(Version39.StreamContributesToConnectionFlowControl(1)).To(BeFalse())
Expect(Version39.StreamContributesToConnectionFlowControl(2)).To(BeTrue())
Expect(Version39.StreamContributesToConnectionFlowControl(3)).To(BeFalse())
Expect(Version39.StreamContributesToConnectionFlowControl(4)).To(BeTrue())
Expect(Version39.StreamContributesToConnectionFlowControl(5)).To(BeTrue())
})
It("says if a stream contributes to connection-level flowcontrol, for TLS", func() {
Expect(VersionTLS.StreamContributesToConnectionFlowControl(0)).To(BeFalse())
Expect(VersionTLS.StreamContributesToConnectionFlowControl(1)).To(BeTrue())
Expect(VersionTLS.StreamContributesToConnectionFlowControl(2)).To(BeTrue())
Expect(VersionTLS.StreamContributesToConnectionFlowControl(3)).To(BeTrue())
})
It("recognizes supported versions", func() {
Expect(IsSupportedVersion(SupportedVersions, 0)).To(BeFalse())
Expect(IsSupportedVersion(SupportedVersions, SupportedVersions[0])).To(BeTrue())