Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AdjustWindowDynamic()

void System.Net.Http.Http2Connection.Http2StreamWindowManager.AdjustWindowDynamic ( int bytesConsumed,
Http2Stream stream )
inlineprivate

Definition at line 1523 of file Http2Connection.cs.

1524 {
1527 {
1528 return;
1529 }
1530 int num = _deliveredBytes;
1532 Http2Connection connection = stream.Connection;
1533 TimeSpan minRtt = connection._rttEstimator.MinRtt;
1535 {
1537 if ((double)_deliveredBytes * (double)minRtt.Ticks > (double)(_streamWindowSize * timeSpan.Ticks) * WindowScaleThresholdMultiplier)
1538 {
1539 int num2 = Math.Min(MaxStreamWindowSize, _streamWindowSize * 2);
1540 num += num2 - _streamWindowSize;
1542 if (System.Net.NetEventSource.Log.IsEnabled())
1543 {
1544 stream.Trace($"[FlowControl] Updated Stream Window. StreamWindowSize: {StreamWindowSize}, StreamWindowThreshold: {StreamWindowThreshold}", "AdjustWindowDynamic");
1545 }
1547 {
1548 stream.Trace($"[FlowControl] StreamWindowSize reached the configured maximum of {MaxStreamWindowSize}.", "AdjustWindowDynamic");
1549 }
1550 }
1551 }
1552 _deliveredBytes = 0;
1553 Task task = connection.SendWindowUpdateAsync(stream.StreamId, num);
1554 connection.LogExceptions(task);
1556 }
Http2Connection(HttpConnectionPool pool, Stream stream)
static readonly System.Net.NetEventSource Log
static TimeSpan StopwatchTicksToTimeSpan(long stopwatchTicks)

References System.Net.Http.Http2Connection.Http2StreamWindowManager._deliveredBytes, System.Net.Http.Http2Connection.Http2StreamWindowManager._lastWindowUpdate, System.Net.Http.Http2Connection._rttEstimator, System.Net.Http.Http2Connection.Http2StreamWindowManager._streamWindowSize, System.Diagnostics.Stopwatch.GetTimestamp(), System.Net.NetEventSource.Log, System.Net.Http.HttpConnectionBase.LogExceptions(), System.Net.Http.Http2Connection.Http2StreamWindowManager.MaxStreamWindowSize, System.Math.Min(), System.Net.Http.Http2Connection.RttEstimator.MinRtt, System.Net.Http.Http2Connection.SendWindowUpdateAsync(), System.Net.Http.Http2Connection.Http2StreamWindowManager.StopwatchTicksToTimeSpan(), System.stream, System.Net.Http.Http2Connection.Http2StreamWindowManager.StreamWindowThreshold, System.task, System.Net.Http.Http2Connection.Http2StreamWindowManager.WindowScaleThresholdMultiplier, and System.TimeSpan.Zero.

Referenced by System.Net.Http.Http2Connection.Http2StreamWindowManager.AdjustWindow().