forked from quic-go/quic-go
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user