mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
remove the error return value from Stream.CancelWrite
This commit is contained in:
parent
ca939df44e
commit
3372fa794c
7 changed files with 24 additions and 32 deletions
|
@ -527,8 +527,7 @@ var _ = Describe("Send Stream", func() {
|
|||
})
|
||||
mockSender.EXPECT().onStreamCompleted(streamID)
|
||||
str.writeOffset = 1234
|
||||
err := str.CancelWrite(9876)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
str.CancelWrite(9876)
|
||||
})
|
||||
|
||||
It("unblocks Write", func() {
|
||||
|
@ -549,7 +548,7 @@ var _ = Describe("Send Stream", func() {
|
|||
waitForWrite()
|
||||
frame, _ := str.popStreamFrame(50)
|
||||
Expect(frame).ToNot(BeNil())
|
||||
Expect(str.CancelWrite(1234)).To(Succeed())
|
||||
str.CancelWrite(1234)
|
||||
Eventually(writeReturned).Should(BeClosed())
|
||||
Expect(n).To(BeEquivalentTo(frame.DataLen()))
|
||||
})
|
||||
|
@ -571,7 +570,7 @@ var _ = Describe("Send Stream", func() {
|
|||
frame, hasMoreData := str.popStreamFrame(50)
|
||||
Expect(hasMoreData).To(BeTrue())
|
||||
Expect(frame).ToNot(BeNil())
|
||||
Expect(str.CancelWrite(1234)).To(Succeed())
|
||||
str.CancelWrite(1234)
|
||||
frame, hasMoreData = str.popStreamFrame(10)
|
||||
Expect(hasMoreData).To(BeFalse())
|
||||
Expect(frame).To(BeNil())
|
||||
|
@ -589,7 +588,7 @@ var _ = Describe("Send Stream", func() {
|
|||
It("doesn't allow further calls to Write", func() {
|
||||
mockSender.EXPECT().queueControlFrame(gomock.Any())
|
||||
mockSender.EXPECT().onStreamCompleted(streamID)
|
||||
Expect(str.CancelWrite(1234)).To(Succeed())
|
||||
str.CancelWrite(1234)
|
||||
_, err := strWithTimeout.Write([]byte("foobar"))
|
||||
Expect(err).To(MatchError("Write on stream 1337 canceled with error code 1234"))
|
||||
})
|
||||
|
@ -597,15 +596,15 @@ var _ = Describe("Send Stream", func() {
|
|||
It("only cancels once", func() {
|
||||
mockSender.EXPECT().queueControlFrame(&wire.ResetStreamFrame{StreamID: streamID, ErrorCode: 1234})
|
||||
mockSender.EXPECT().onStreamCompleted(streamID)
|
||||
Expect(str.CancelWrite(1234)).To(Succeed())
|
||||
Expect(str.CancelWrite(4321)).To(Succeed())
|
||||
str.CancelWrite(1234)
|
||||
str.CancelWrite(4321)
|
||||
})
|
||||
|
||||
It("doesn't do anything when the stream was already closed", func() {
|
||||
mockSender.EXPECT().onHasStreamData(streamID)
|
||||
Expect(str.Close()).To(Succeed())
|
||||
// don't EXPECT any calls to queueControlFrame
|
||||
Expect(str.CancelWrite(123)).To(Succeed())
|
||||
str.CancelWrite(123)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue