forked from quic-go/quic-go
don't unlock the receive stream mutex for copying from STREAM frames
This commit is contained in:
@@ -166,13 +166,10 @@ func (s *receiveStream) readImpl(p []byte) (bool /*stream completed */, int, err
|
|||||||
return false, bytesRead, fmt.Errorf("BUG: readPosInFrame (%d) > frame.DataLen (%d) in stream.Read", s.readPosInFrame, len(s.currentFrame))
|
return false, bytesRead, fmt.Errorf("BUG: readPosInFrame (%d) > frame.DataLen (%d) in stream.Read", s.readPosInFrame, len(s.currentFrame))
|
||||||
}
|
}
|
||||||
|
|
||||||
s.mutex.Unlock()
|
|
||||||
|
|
||||||
m := copy(p[bytesRead:], s.currentFrame[s.readPosInFrame:])
|
m := copy(p[bytesRead:], s.currentFrame[s.readPosInFrame:])
|
||||||
s.readPosInFrame += m
|
s.readPosInFrame += m
|
||||||
bytesRead += m
|
bytesRead += m
|
||||||
|
|
||||||
s.mutex.Lock()
|
|
||||||
// when a RESET_STREAM was received, the was already informed about the final byteOffset for this stream
|
// when a RESET_STREAM was received, the was already informed about the final byteOffset for this stream
|
||||||
if !s.resetRemotely {
|
if !s.resetRemotely {
|
||||||
s.flowController.AddBytesRead(protocol.ByteCount(m))
|
s.flowController.AddBytesRead(protocol.ByteCount(m))
|
||||||
|
|||||||
Reference in New Issue
Block a user