Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Servers/Kestrel/Core/src/KestrelServerLimits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public class KestrelServerLimits
// Matches the default LimitRequestFields in Apache httpd.
private int _maxRequestHeaderCount = 100;

// Matches the default http.sys connectionTimeout.
private TimeSpan _keepAliveTimeout = TimeSpan.FromMinutes(2);
// Slightly more than SocketHttpHandler's old PooledConnectionIdleTimeout of 2 minutes.
// https://github.com/dotnet/runtime/issues/52267
private TimeSpan _keepAliveTimeout = TimeSpan.FromSeconds(130);

private TimeSpan _requestHeadersTimeout = TimeSpan.FromSeconds(30);

Expand Down Expand Up @@ -169,7 +170,7 @@ public long? MaxRequestBodySize

/// <summary>
/// Gets or sets the keep-alive timeout.
/// Defaults to 2 minutes.
/// Defaults to 130 seconds.
/// </summary>
/// <remarks>
/// </remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void MaxRequestHeaderCountValid(int value)
[Fact]
public void KeepAliveTimeoutDefault()
{
Assert.Equal(TimeSpan.FromMinutes(2), new KestrelServerLimits().KeepAliveTimeout);
Assert.Equal(TimeSpan.FromSeconds(130), new KestrelServerLimits().KeepAliveTimeout);
}

[Theory]
Expand Down