Merge pull request #1212 from lucas-clemente/refactor-retransmissions

refactor retransmissions
This commit is contained in:
Marten Seemann
2018-03-02 17:53:56 +07:00
committed by GitHub
8 changed files with 346 additions and 229 deletions

View File

@@ -77,6 +77,11 @@ func (vn VersionNumber) UsesIETFFrameFormat() bool {
return vn != Version39
}
// UsesStopWaitingFrames tells if this version uses STOP_WAITING frames
func (vn VersionNumber) UsesStopWaitingFrames() bool {
return vn == Version39
}
// StreamContributesToConnectionFlowControl says if a stream contributes to connection-level flow control
func (vn VersionNumber) StreamContributesToConnectionFlowControl(id StreamID) bool {
if id == vn.CryptoStreamID() {

View File

@@ -70,6 +70,11 @@ var _ = Describe("Version", func() {
Expect(VersionTLS.UsesIETFFrameFormat()).To(BeTrue())
})
It("tells if a version uses STOP_WAITING frames", func() {
Expect(Version39.UsesStopWaitingFrames()).To(BeTrue())
Expect(VersionTLS.UsesStopWaitingFrames()).To(BeFalse())
})
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())