remove the error return value from Stream.CancelRead

This commit is contained in:
Marten Seemann 2019-01-24 09:31:34 +07:00
parent 3808191679
commit ca939df44e
7 changed files with 22 additions and 27 deletions

View file

@ -82,7 +82,7 @@ var _ = Describe("Stream Cancelations", func() {
// cancel around 2/3 of the streams
if rand.Int31()%3 != 0 {
atomic.AddInt32(&canceledCounter, 1)
Expect(str.CancelRead(quic.ErrorCode(str.StreamID()))).To(Succeed())
str.CancelRead(quic.ErrorCode(str.StreamID()))
return
}
data, err := ioutil.ReadAll(str)
@ -128,7 +128,7 @@ var _ = Describe("Stream Cancelations", func() {
length := int(rand.Int31n(int32(len(testserver.PRData) - 1)))
data, err := ioutil.ReadAll(io.LimitReader(str, int64(length)))
Expect(err).ToNot(HaveOccurred())
Expect(str.CancelRead(quic.ErrorCode(str.StreamID()))).To(Succeed())
str.CancelRead(quic.ErrorCode(str.StreamID()))
Expect(data).To(Equal(testserver.PRData[:length]))
atomic.AddInt32(&canceledCounter, 1)
return
@ -309,7 +309,7 @@ var _ = Describe("Stream Cancelations", func() {
Expect(err).ToNot(HaveOccurred())
// cancel around half of the streams
if rand.Int31()%2 == 0 {
Expect(str.CancelRead(quic.ErrorCode(str.StreamID()))).To(Succeed())
str.CancelRead(quic.ErrorCode(str.StreamID()))
return
}
data, err := ioutil.ReadAll(str)
@ -401,7 +401,7 @@ var _ = Describe("Stream Cancelations", func() {
}
Expect(data).To(Equal(testserver.PRData[:length]))
if length < len(testserver.PRData) {
Expect(str.CancelRead(quic.ErrorCode(str.StreamID()))).To(Succeed())
str.CancelRead(quic.ErrorCode(str.StreamID()))
return
}