diff --git a/session_test.go b/session_test.go index a6aed96..d6bcca3 100644 --- a/session_test.go +++ b/session_test.go @@ -1195,7 +1195,6 @@ func TestSession_PartialReadWindowUpdate(t *testing.T) { sendWindow := atomic.LoadUint32(&wr.sendWindow) if sendWindow != initialStreamWindow { t.Errorf("sendWindow: exp=%d, got=%d", client.config.InitialStreamWindowSize, sendWindow) - return } n, err := wr.Write(make([]byte, flood)) diff --git a/stream.go b/stream.go index 25f3036..2f95cc9 100644 --- a/stream.go +++ b/stream.go @@ -214,8 +214,9 @@ func (s *Stream) sendWindowUpdate() error { if !needed { return nil } + now := time.Now() - if rtt := s.session.getRTT(); rtt > 0 && now.Sub(s.epochStart) < rtt*4 { + if rtt := s.session.getRTT(); flags == 0 && rtt > 0 && now.Sub(s.epochStart) < rtt*4 { var recvWindow uint32 if s.recvWindow > math.MaxUint32/2 { recvWindow = min(math.MaxUint32, s.session.config.MaxStreamWindowSize)