Skip to content

Commit ec05ce5

Browse files
committed
Update
1 parent 9b06402 commit ec05ce5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Servers/Kestrel/Core/src/Internal/Infrastructure/TimeoutControl.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,11 @@ void IConnectionTimeoutFeature.ResetTimeout(TimeSpan timeSpan)
333333

334334
public long GetResponseDrainDeadline(long ticks, MinDataRate minRate)
335335
{
336-
var timestamp = Math.Max(_writeTimingTimeoutTimestamp, ticks + minRate.GracePeriod.Ticks);
336+
// On grace period overflow, use max value.
337+
var gracePeriod = ticks + minRate.GracePeriod.Ticks;
338+
gracePeriod = gracePeriod >= 0 ? gracePeriod : long.MaxValue;
337339

338-
return timestamp >= 0 ? timestamp : long.MaxValue;
340+
return Math.Max(_writeTimingTimeoutTimestamp, gracePeriod);
339341
}
340342
}
341343
}

0 commit comments

Comments
 (0)