22 writes to Limits
InMemory.FunctionalTests (12)
MaxRequestBodySizeTests.cs (11)
41
new TestServiceContext(LoggerFactory) { ServerOptions = {
Limits
= { MaxRequestBodySize = globalMaxRequestBodySize } } }))
88
new TestServiceContext(LoggerFactory) { ServerOptions = {
Limits
= { MaxRequestBodySize = maxRequestBodySize } } }))
135
new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory)) { ServerOptions = {
Limits
= { MaxRequestBodySize = maxRequestBodySize } } }))
184
new TestServiceContext(LoggerFactory) { ServerOptions = {
Limits
= { MaxRequestBodySize = globalMaxRequestBodySize } } }))
228
new TestServiceContext(LoggerFactory) { ServerOptions = {
Limits
= { MaxRequestBodySize = 0 } } }))
252
new TestServiceContext { ServerOptions = {
Limits
= { MaxRequestBodySize = 0 } } }))
384
new TestServiceContext(LoggerFactory, metrics: new KestrelMetrics(testMeterFactory)) { ServerOptions = {
Limits
= { MaxRequestBodySize = 0 } } }))
437
new TestServiceContext(LoggerFactory) { ServerOptions = {
Limits
= { MaxRequestBodySize = globalMaxRequestBodySize } } }))
483
new TestServiceContext(LoggerFactory) { ServerOptions = {
Limits
= { MaxRequestBodySize = globalMaxRequestBodySize } } }))
546
new TestServiceContext(LoggerFactory) { ServerOptions = {
Limits
= { MaxRequestBodySize = globalMaxRequestBodySize } } }))
597
new TestServiceContext(LoggerFactory) { ServerOptions = {
Limits
= { MaxRequestBodySize = 0 } } }))
MaxRequestLineSizeTests.cs (1)
90
Limits
=
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
KestrelServerTests.cs (2)
223
Limits
=
249
Limits
=
Sockets.FunctionalTests (8)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (1)
1038
Limits
=
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (7)
288
Limits
=
513
Limits
=
647
Limits
=
768
Limits
=
866
Limits
=
943
Limits
=
1030
Limits
=
196 references to Limits
Binding.Http.IntegrationTests (1)
MtomBindingTestHelper.cs (1)
47
serverOptions.
Limits
.MaxRequestBodySize = 5_368_709_120;
InMemory.FunctionalTests (116)
ChunkedRequestTests.cs (2)
490
testContext.ServerOptions.
Limits
.MaxRequestHeadersTotalSize =
537
testContext.ServerOptions.
Limits
.MaxRequestHeaderCount = 2;
ConnectionLimitTests.cs (1)
229
serviceContext.ServerOptions.
Limits
.MaxConcurrentConnections = max;
Http2\Http2ConnectionTests.cs (25)
648
_serviceContext.ServerOptions.
Limits
.MinRequestBodyDataRate = null;
739
_serviceContext.ServerOptions.
Limits
.Http2.MaxFrameSize = length;
826
var initialStreamWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialStreamWindowSize;
828
var initialConnectionWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize;
928
var initialStreamWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialStreamWindowSize;
930
var initialConnectionWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize;
1059
var initialStreamWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialStreamWindowSize;
1060
var initialConnectionWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize;
1279
var initialWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialStreamWindowSize;
1349
var initialConnectionWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize;
1389
_serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize = 128 * 1024;
1390
_serviceContext.ServerOptions.
Limits
.Http2.InitialStreamWindowSize = 96 * 1024;
1392
var initialStreamWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialStreamWindowSize;
1394
var initialConnectionWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize;
1640
_serviceContext.ServerOptions.
Limits
.Http2.MaxStreamsPerConnection = 1;
1675
_serviceContext.ServerOptions.
Limits
.Http2.MaxStreamsPerConnection = 1;
1688
_serviceContext.ServerOptions.
Limits
.Http2.MaxStreamsPerConnection = 100;
1701
_serviceContext.ServerOptions.
Limits
.Http2.MaxStreamsPerConnection = int.MaxValue;
1714
_serviceContext.ServerOptions.
Limits
.Http2.MaxStreamsPerConnection = 1;
1793
_serviceContext.ServerOptions.
Limits
.Http2.MaxStreamsPerConnection = maxStreamsPerConnection;
1854
var initialWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialStreamWindowSize;
1878
var initialWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize;
2347
_serviceContext.ServerOptions.
Limits
.Http2.HeaderTableSize = 0;
3408
var initialConnectionWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize;
4019
_serviceContext.ServerOptions.
Limits
.Http2.HeaderTableSize = 40000;
Http2\Http2KeepAliveTests.cs (17)
14
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = Timeout.InfiniteTimeSpan;
27
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
28
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingTimeout = Timeout.InfiniteTimeSpan;
57
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
79
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
102
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(5);
119
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
142
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
180
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
181
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingTimeout = TimeSpan.FromSeconds(3);
212
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
213
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingTimeout = TimeSpan.FromSeconds(3);
244
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
268
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
271
_serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize = 65535;
322
_serviceContext.ServerOptions.
Limits
.Http2.KeepAlivePingDelay = TimeSpan.FromSeconds(1);
325
_serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize = 65535;
Http2\Http2StreamTests.cs (7)
1856
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 15;
1897
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 10;
1943
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 15;
1983
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 10;
2035
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 20;
2095
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 10;
3651
_serviceContext.ServerOptions.
Limits
.Http2.MaxFrameSize = 17001;
Http2\Http2TestBase.cs (3)
1411
pauseWriterThreshold: serviceContext.ServerOptions.
Limits
.MaxRequestBufferSize ?? 0,
1412
resumeWriterThreshold: serviceContext.ServerOptions.
Limits
.MaxRequestBufferSize ?? 0,
1430
var bufferSize = serviceContext.ServerOptions.
Limits
.MaxResponseBufferSize;
Http2\Http2TimeoutTests.cs (19)
19
var limits = _serviceContext.ServerOptions.
Limits
;
41
var limits = _serviceContext.ServerOptions.
Limits
;
61
var limits = _serviceContext.ServerOptions.
Limits
;
110
var limits = _serviceContext.ServerOptions.
Limits
;
133
var limits = _serviceContext.ServerOptions.
Limits
;
174
var limits = _serviceContext.ServerOptions.
Limits
;
209
var limits = _serviceContext.ServerOptions.
Limits
;
350
var limits = _serviceContext.ServerOptions.
Limits
;
403
var limits = _serviceContext.ServerOptions.
Limits
;
458
var limits = _serviceContext.ServerOptions.
Limits
;
510
var limits = _serviceContext.ServerOptions.
Limits
;
564
var limits = _serviceContext.ServerOptions.
Limits
;
630
var limits = _serviceContext.ServerOptions.
Limits
;
677
var limits = _serviceContext.ServerOptions.
Limits
;
728
var limits = _serviceContext.ServerOptions.
Limits
;
795
var limits = _serviceContext.ServerOptions.
Limits
;
863
var limits = _serviceContext.ServerOptions.
Limits
;
915
var initialConnectionWindowSize = _serviceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize;
920
var limits = _serviceContext.ServerOptions.
Limits
;
Http2\Http2WebSocketTests.cs (3)
325
var limits = _serviceContext.ServerOptions.
Limits
;
387
var limits = _serviceContext.ServerOptions.
Limits
;
403
Assert.Equal(_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize + 1, memoryStream.Length);
Http3\Http3StreamTests.cs (10)
2378
var limit = _serviceContext.ServerOptions.
Limits
.Http3.MaxRequestHeaderFieldSize;
2514
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 15;
2548
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 10;
2588
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 15;
2621
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 10;
2665
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 20;
2717
_serviceContext.ServerOptions.
Limits
.MaxRequestBodySize = 10;
3073
_serviceContext.ServerOptions.
Limits
.MaxRequestBufferSize = 100;
3138
_serviceContext.ServerOptions.
Limits
.MaxRequestBufferSize = 1;
3222
_serviceContext.ServerOptions.
Limits
.MaxRequestBufferSize = 1;
Http3\Http3TimeoutTests.cs (18)
21
var limits = _serviceContext.ServerOptions.
Limits
;
37
var limits = _serviceContext.ServerOptions.
Limits
;
61
var limits = _serviceContext.ServerOptions.
Limits
;
90
var limits = _serviceContext.ServerOptions.
Limits
;
131
var limits = _serviceContext.ServerOptions.
Limits
;
165
var limits = _serviceContext.ServerOptions.
Limits
;
219
var limits = _serviceContext.ServerOptions.
Limits
;
247
var limits = _serviceContext.ServerOptions.
Limits
;
283
var limits = _serviceContext.ServerOptions.
Limits
;
308
var limits = _serviceContext.ServerOptions.
Limits
;
338
var limits = _serviceContext.ServerOptions.
Limits
;
380
var limits = _serviceContext.ServerOptions.
Limits
;
448
var limits = _serviceContext.ServerOptions.
Limits
;
490
var limits = _serviceContext.ServerOptions.
Limits
;
532
var limits = _serviceContext.ServerOptions.
Limits
;
578
var limits = _serviceContext.ServerOptions.
Limits
;
633
var limits = _serviceContext.ServerOptions.
Limits
;
689
var limits = _serviceContext.ServerOptions.
Limits
;
KeepAliveTimeoutTests.cs (2)
252
context.ServerOptions.
Limits
.KeepAliveTimeout = _keepAliveTimeout;
253
context.ServerOptions.
Limits
.MinRequestBodyDataRate = null;
RequestHeaderLimitsTests.cs (2)
167
options.
Limits
.MaxRequestHeaderCount = maxRequestHeaderCount.Value;
172
options.
Limits
.MaxRequestHeadersTotalSize = maxRequestHeadersTotalSize.Value;
RequestHeadersTimeoutTests.cs (3)
126
testContext.ServerOptions.
Limits
.MinResponseDataRate = null;
155
context.ServerOptions.
Limits
.RequestHeadersTimeout = RequestHeadersTimeout;
156
context.ServerOptions.
Limits
.MinRequestBodyDataRate = null;
RequestTests.cs (1)
888
testContext.ServerOptions.
Limits
.MinRequestBodyDataRate = null;
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (3)
367
pauseWriterThreshold: serviceContext.ServerOptions.
Limits
.MaxRequestBufferSize ?? 0,
368
resumeWriterThreshold: serviceContext.ServerOptions.
Limits
.MaxRequestBufferSize ?? 0,
386
var bufferSize = serviceContext.ServerOptions.
Limits
.MaxResponseBufferSize;
Interop.FunctionalTests (5)
Http3\Http3RequestTests.cs (1)
2021
kestrel.
Limits
.MinRequestBodyDataRate = null;
HttpClientHttp2InteropTests.cs (4)
1139
options.
Limits
.Http2.HeaderTableSize = 1;
1199
options.
Limits
.Http2.MaxStreamsPerConnection = 5;
1260
options.
Limits
.Http2.MaxStreamsPerConnection = 5;
1318
webHostBuilder.ConfigureKestrel(options => options.
Limits
.Http2.MaxFrameSize = 1024 * 20); // The default is 16kb
InteropWebsite (1)
Program.cs (1)
50
options.
Limits
.MinRequestBodyDataRate = null;
Microsoft.AspNetCore.Server.Kestrel.Core (46)
Internal\Http\Http1Connection.cs (7)
92
TimeoutControl.StartDrainTimeout(MinResponseDataRate, ServerOptions.
Limits
.MaxResponseBufferSize);
184
TimeoutControl.ResetTimeout(ServerOptions.
Limits
.RequestHeadersTimeout, TimeoutReason.RequestHeaders);
215
if (reader.Remaining >= ServerOptions.
Limits
.MaxRequestLineSize)
225
var trimmedBuffer = reader.Sequence.Slice(reader.Position, ServerOptions.
Limits
.MaxRequestLineSize);
687
_remainingRequestHeadersBytesAllowed = (long)ServerOptions.
Limits
.MaxRequestHeadersTotalSize + 2;
689
MinResponseDataRate = ServerOptions.
Limits
.MinResponseDataRate;
712
TimeoutControl.SetTimeout(ServerOptions.
Limits
.KeepAliveTimeout, TimeoutReason.KeepAlive);
Internal\Http\HttpProtocol.cs (3)
356
MaxRequestBodySize = ServerOptions.
Limits
.MaxRequestBodySize;
357
MinRequestBodyDataRate = ServerOptions.
Limits
.MinRequestBodyDataRate;
428
_eagerRequestHeadersParsedLimit = ServerOptions.
Limits
.MaxRequestHeaderCount;
Internal\Http2\Http2Connection.cs (4)
154
var httpLimits = context.ServiceContext.ServerOptions.
Limits
;
215
public KestrelServerLimits Limits => _context.ServiceContext.ServerOptions.
Limits
;
310
var connectionWindow = _context.ServiceContext.ServerOptions.
Limits
.Http2.InitialConnectionWindowSize;
1581
if (_totalParsedHeaderSize > _context.ServiceContext.ServerOptions.
Limits
.MaxRequestHeadersTotalSize * 2)
Internal\Http2\Http2Stream.cs (4)
60
_eagerRequestHeadersParsedLimit = ServerOptions.
Limits
.MaxRequestHeaderCount * 2;
221
if (TotalParsedHeaderSize > ServerOptions.
Limits
.MaxRequestHeadersTotalSize)
227
if (RequestHeadersParsed > ServerOptions.
Limits
.MaxRequestHeaderCount)
334
if (requestLineLength > ServerOptions.
Limits
.MaxRequestLineSize)
Internal\Http3\Http3Connection.cs (4)
62
var httpLimits = context.ServiceContext.ServerOptions.
Limits
;
96
public KestrelServerLimits Limits => _context.ServiceContext.ServerOptions.
Limits
;
259
var requestHeadersTimeout = serviceContext.ServerOptions.
Limits
.RequestHeadersTimeout.ToTicks(
307
var minDataRate = _context.ServiceContext.ServerOptions.
Limits
.MinResponseDataRate;
Internal\Http3\Http3ControlStream.cs (1)
50
var httpLimits = context.ServiceContext.ServerOptions.
Limits
;
Internal\Http3\Http3Stream.cs (8)
85
public KestrelServerLimits Limits => _context.ServiceContext.ServerOptions.
Limits
;
113
_eagerRequestHeadersParsedLimit = ServerOptions.
Limits
.MaxRequestHeaderCount * 2;
123
context.ServiceContext.ServerOptions.
Limits
.MinResponseDataRate,
137
QPackDecoder = new QPackDecoder(_context.ServiceContext.ServerOptions.
Limits
.Http3.MaxRequestHeaderFieldSize);
300
if (_totalParsedHeaderSize > ServerOptions.
Limits
.MaxRequestHeadersTotalSize * 2)
1007
if (_totalParsedHeaderSize > ServerOptions.
Limits
.MaxRequestHeadersTotalSize)
1013
if (RequestHeadersParsed > ServerOptions.
Limits
.MaxRequestHeaderCount)
1096
if (requestLineLength > ServerOptions.
Limits
.MaxRequestLineSize)
Internal\KestrelServerImpl.cs (13)
87
serverOptions.
Limits
.MaxConcurrentUpgradedConnections);
201
connectionDelegate = EnforceConnectionLimit(connectionDelegate, Options.
Limits
.MaxConcurrentConnections, Trace, ServiceContext.Metrics);
220
multiplexedConnectionDelegate = EnforceConnectionLimit(multiplexedConnectionDelegate, Options.
Limits
.MaxConcurrentConnections, Trace, ServiceContext.Metrics);
417
if (Options.
Limits
.MaxRequestBufferSize.HasValue &&
418
Options.
Limits
.MaxRequestBufferSize < Options.
Limits
.MaxRequestLineSize)
421
CoreStrings.FormatMaxRequestBufferSmallerThanRequestLineBuffer(Options.
Limits
.MaxRequestBufferSize.Value, Options.
Limits
.MaxRequestLineSize));
424
if (Options.
Limits
.MaxRequestBufferSize.HasValue &&
425
Options.
Limits
.MaxRequestBufferSize < Options.
Limits
.MaxRequestHeadersTotalSize)
428
CoreStrings.FormatMaxRequestBufferSmallerThanRequestHeaderBuffer(Options.
Limits
.MaxRequestBufferSize.Value, Options.
Limits
.MaxRequestHeadersTotalSize));
KestrelServerOptions.cs (2)
358
writer.WritePropertyName(nameof(
Limits
));
360
Limits
.Serialize(writer);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (13)
Http1\Http1ConnectionTests.cs (13)
63
_serviceContext.ServerOptions.
Limits
.MaxRequestHeadersTotalSize = int.MaxValue;
74
_serviceContext.ServerOptions.
Limits
.MaxRequestHeadersTotalSize = headerLine.Length - 1;
91
_serviceContext.ServerOptions.
Limits
.MaxRequestHeaderCount = 1;
114
_serviceContext.ServerOptions.
Limits
.MaxRequestHeadersTotalSize = headerLine.Length;
170
Assert.Same(_serviceContext.ServerOptions.
Limits
.MinRequestBodyDataRate, _http1Connection.MinRequestBodyDataRate);
180
Assert.Same(_serviceContext.ServerOptions.
Limits
.MinResponseDataRate, _http1Connection.MinResponseDataRate);
269
options.
Limits
.MaxRequestHeadersTotalSize = headerLine1.Length;
270
options.
Limits
.MaxRequestHeaderCount = 1;
453
_timeoutControl.Verify(cc => cc.ResetTimeout(_serviceContext.ServerOptions.
Limits
.RequestHeadersTimeout, TimeoutReason.RequestHeaders));
459
_serviceContext.ServerOptions.
Limits
.MaxRequestLineSize = "GET / HTTP/1.1\r\n".Length;
575
var expectedKeepAliveTimeout = _serviceContext.ServerOptions.
Limits
.KeepAliveTimeout;
870
_serviceContext.ServerOptions.
Limits
.MaxRequestHeaderCount = header0Count + header1Count;
902
_serviceContext.ServerOptions.
Limits
.MaxRequestHeaderCount = header0Count + header1Count;
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (3)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (3)
367
pauseWriterThreshold: serviceContext.ServerOptions.
Limits
.MaxRequestBufferSize ?? 0,
368
resumeWriterThreshold: serviceContext.ServerOptions.
Limits
.MaxRequestBufferSize ?? 0,
386
var bufferSize = serviceContext.ServerOptions.
Limits
.MaxResponseBufferSize;
Sockets.BindTests (1)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
70
_host = TransportSelector.GetHostBuilder(context.ServerOptions.
Limits
.MaxRequestBufferSize)
Sockets.FunctionalTests (10)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
70
_host = TransportSelector.GetHostBuilder(context.ServerOptions.
Limits
.MaxRequestBufferSize)
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (7)
319
options.
Limits
.MaxRequestBufferSize = maxRequestBufferSize;
322
maxRequestBufferSize.Value < options.
Limits
.MaxRequestLineSize)
324
options.
Limits
.MaxRequestLineSize = (int)maxRequestBufferSize;
328
maxRequestBufferSize.Value < options.
Limits
.MaxRequestHeadersTotalSize)
330
options.
Limits
.MaxRequestHeadersTotalSize = (int)maxRequestBufferSize;
333
options.
Limits
.MinRequestBodyDataRate = null;
335
options.
Limits
.MaxRequestBodySize = _dataLength;
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
80
options.
Limits
.MaxRequestBodySize = contentLength;
81
options.
Limits
.MinRequestBodyDataRate = null;