fix a panic in stream with large window updates

fixes #143
This commit is contained in:
Lucas Clemente
2016-05-25 13:12:06 +02:00
parent 9e0d211f5e
commit 17865dbba7
2 changed files with 12 additions and 2 deletions

View File

@@ -464,6 +464,16 @@ var _ = Describe("Stream", func() {
Expect(b).To(BeTrue())
Expect(err).To(MatchError(testErr))
})
It("works with large flow control windows", func() {
// This paniced before due to a wrong cast,
// see https://github.com/lucas-clemente/quic-go/issues/143
str.contributesToConnectionFlowControl = false
updated := str.UpdateSendFlowControlWindow(protocol.ByteCount(1) << 63)
Expect(updated).To(BeTrue())
_, err := str.Write([]byte("foobar"))
Expect(err).NotTo(HaveOccurred())
})
})
})