forked from quic-go/quic-go
don't cancel streams after shutdown (#4673)
This ensures that `stream.Write` and `stream.Read` return the error code from connection close, if the stream was closed as a result of connection close.
This commit is contained in:
@@ -630,6 +630,17 @@ var _ = Describe("Receive Stream", func() {
|
||||
Fin: true,
|
||||
})).To(Succeed())
|
||||
})
|
||||
|
||||
It("ignores cancellations after closeForShutdown", func() {
|
||||
closeErr := errors.New("closed for shutdown")
|
||||
str.closeForShutdown(closeErr)
|
||||
buf := make([]byte, 100)
|
||||
_, err := str.Read(buf)
|
||||
Expect(err).To(Equal(closeErr))
|
||||
str.CancelRead(42)
|
||||
_, err = str.Read(buf)
|
||||
Expect(err).To(Equal(closeErr))
|
||||
})
|
||||
})
|
||||
|
||||
Context("receiving RESET_STREAM frames", func() {
|
||||
|
||||
Reference in New Issue
Block a user