don’t add bytes read after receiving a RST_STREAM to flow controller

This commit is contained in:
Marten Seemann
2017-01-09 10:15:12 +07:00
parent d246a295d2
commit 980d0e398f
2 changed files with 21 additions and 1 deletions

View File

@@ -120,7 +120,10 @@ func (s *stream) Read(p []byte) (int, error) {
bytesRead += m
s.readOffset += protocol.ByteCount(m)
s.flowControlManager.AddBytesRead(s.streamID, protocol.ByteCount(m))
// when a RST_STREAM was received, the was already informed about the final byteOffset for this stream
if !s.resetRemotely.Get() {
s.flowControlManager.AddBytesRead(s.streamID, protocol.ByteCount(m))
}
s.onData() // so that a possible WINDOW_UPDATE is sent
if s.readPosInFrame >= int(frame.DataLen()) {