@@ -21,7 +21,32 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
21
21
{
22
22
public class MaxRequestBufferSizeTests : LoggedTest
23
23
{
24
- private const int _dataLength = 20 * 1024 * 1024 ;
24
+ // The client is typically paused after uploading this many bytes:
25
+ //
26
+ // OS MaxRequestBufferSize (MB) connectionAdapter Transport min pause (MB) max pause (MB)
27
+ // --------------- ------------------------- ----------------- --------- -------------- --------------
28
+ // Windows 10 1803 1 false Libuv 1.7 3.3
29
+ // Windows 10 1803 1 false Sockets 1.7 4.4
30
+ // Windows 10 1803 1 true Libuv 3.0 8.4
31
+ // Windows 10 1803 1 true Sockets 3.2 9.0
32
+ //
33
+ // Windows 10 1803 5 false Libuv 6 13
34
+ // Windows 10 1803 5 false Sockets 7 24
35
+ // Windows 10 1803 5 true Libuv 12 12
36
+ // Windows 10 1803 5 true Sockets 12 36
37
+ // Ubuntu 18.04 5 false Libuv 13 15
38
+ // Ubuntu 18.04 5 false Sockets 13 15
39
+ // Ubuntu 18.04 5 true Libuv 19 20
40
+ // Ubuntu 18.04 5 true Sockets 18 20
41
+ // macOS 10.13.4 5 false Libuv 6 6
42
+ // macOS 10.13.4 5 false Sockets 6 6
43
+ // macOS 10.13.4 5 true Libuv 11 11
44
+ // macOS 10.13.4 5 true Sockets 11 11
45
+ //
46
+ // When connectionAdapter=true, the MaxRequestBufferSize is set on two pipes, so it's effectively doubled.
47
+ //
48
+ // To ensure reliability, _dataLength must be greater than the largest "max pause" in any configuration
49
+ private const int _dataLength = 40 * 1024 * 1024 ;
25
50
26
51
private static readonly string [ ] _requestLines = new [ ]
27
52
{
@@ -47,8 +72,6 @@ public static IEnumerable<object[]> LargeUploadData
47
72
Tuple . Create ( ( long ? ) 1024 * 1024 , true ) ,
48
73
49
74
// Larger than default, but still significantly lower than data, so client should be paused.
50
- // On Windows, the client is usually paused around (MaxRequestBufferSize + 700,000).
51
- // On Linux, the client is usually paused around (MaxRequestBufferSize + 10,000,000).
52
75
Tuple . Create ( ( long ? ) 5 * 1024 * 1024 , true ) ,
53
76
54
77
// Even though maxRequestBufferSize < _dataLength, client should not be paused since the
@@ -286,6 +309,8 @@ private IWebHost StartWebHost(long? maxRequestBufferSize,
286
309
}
287
310
288
311
options . Limits . MinRequestBodyDataRate = null ;
312
+
313
+ options . Limits . MaxRequestBodySize = _dataLength ;
289
314
} )
290
315
. UseContentRoot ( Directory . GetCurrentDirectory ( ) )
291
316
. Configure ( app => app . Run ( async context =>
0 commit comments