mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
don't enqueue stream for sending on reordered MAX_STREAM_DATA frames (#4269)
This commit is contained in:
parent
07ec3245bd
commit
198de32ef6
7 changed files with 47 additions and 22 deletions
|
@ -682,7 +682,7 @@ var _ = Describe("Send Stream", func() {
|
|||
})
|
||||
|
||||
It("says when it has data for sending", func() {
|
||||
mockFC.EXPECT().UpdateSendWindow(gomock.Any())
|
||||
mockFC.EXPECT().UpdateSendWindow(gomock.Any()).Return(true)
|
||||
mockSender.EXPECT().onHasStreamData(streamID)
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
|
@ -698,6 +698,24 @@ var _ = Describe("Send Stream", func() {
|
|||
str.closeForShutdown(nil)
|
||||
Eventually(done).Should(BeClosed())
|
||||
})
|
||||
|
||||
It("doesn't say it has data for sending if the MAX_STREAM_DATA frame was reordered", func() {
|
||||
mockFC.EXPECT().UpdateSendWindow(gomock.Any()).Return(false) // reordered frame
|
||||
mockSender.EXPECT().onHasStreamData(streamID)
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
defer GinkgoRecover()
|
||||
_, err := str.Write([]byte("foobar"))
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
close(done)
|
||||
}()
|
||||
waitForWrite()
|
||||
// don't expect any calls to onHasStreamData
|
||||
str.updateSendWindow(42)
|
||||
// make sure the Write go routine returns
|
||||
str.closeForShutdown(nil)
|
||||
Eventually(done).Should(BeClosed())
|
||||
})
|
||||
})
|
||||
|
||||
Context("stream cancellations", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue