flowcontrol: fix start of the flow-control auto-tuning period (#4730)

The period should start when the first frame is received, not when the data is
first read. This makes a difference when the first STREAM frame is received
out of order.
This commit is contained in:
Marten Seemann
2024-11-28 15:48:42 +08:00
committed by GitHub
parent ca31dd355c
commit 90a824a849
3 changed files with 12 additions and 7 deletions

View File

@@ -46,7 +46,12 @@ func (c *connectionFlowController) IncrementHighestReceived(increment protocol.B
c.mutex.Lock()
defer c.mutex.Unlock()
// If this is the first frame received on this connection, start flow-control auto-tuning.
if c.highestReceived == 0 {
c.startNewAutoTuningEpoch(time.Now())
}
c.highestReceived += increment
if c.checkFlowControlViolation() {
return &qerr.TransportError{
ErrorCode: qerr.FlowControlError,