We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b06402 commit ec05ce5Copy full SHA for ec05ce5
src/Servers/Kestrel/Core/src/Internal/Infrastructure/TimeoutControl.cs
@@ -333,9 +333,11 @@ void IConnectionTimeoutFeature.ResetTimeout(TimeSpan timeSpan)
333
334
public long GetResponseDrainDeadline(long ticks, MinDataRate minRate)
335
{
336
- var timestamp = Math.Max(_writeTimingTimeoutTimestamp, ticks + minRate.GracePeriod.Ticks);
+ // On grace period overflow, use max value.
337
+ var gracePeriod = ticks + minRate.GracePeriod.Ticks;
338
+ gracePeriod = gracePeriod >= 0 ? gracePeriod : long.MaxValue;
339
- return timestamp >= 0 ? timestamp : long.MaxValue;
340
+ return Math.Max(_writeTimingTimeoutTimestamp, gracePeriod);
341
}
342
343
0 commit comments