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:
@@ -423,6 +423,10 @@ func (s *sendStream) CancelWrite(errorCode StreamErrorCode) {
|
||||
|
||||
func (s *sendStream) cancelWriteImpl(errorCode qerr.StreamErrorCode, remote bool) {
|
||||
s.mutex.Lock()
|
||||
if s.closeForShutdownErr != nil {
|
||||
s.mutex.Unlock()
|
||||
return
|
||||
}
|
||||
if !remote {
|
||||
s.cancellationFlagged = true
|
||||
if s.cancelWriteErr != nil {
|
||||
|
||||
Reference in New Issue
Block a user