Commit Graph

718 Commits

Author SHA1 Message Date
Cesar Blum Silveira 0fafd19ec9 Initial HTTP/2 support.
What works:

- HTTP/2 over TLS1.2 with ALPN
- Request and response flow
  - Headers are compressed and decompressed with HPACK
  - Request body can be read by streams (if present)
  - MVC template app with individual auth works fine
- PRIORITY frames are validated
- RST_STREAM frames are validated and abort streams
- SETTINGS frames are validated and ACKed
- PING frames are validated and ACKed
- GOAWAY frames stop connections
- WINDOW_UPDATE frames are validated
- CONTINUATION frames are sent for large header blocks

What doesn't work yet:

- Flow control in either direction
- It's not possible to encode a single header across more than one frame
  - Affects only a very large header (name and value combined ~16KB long)
- Request trailers
- Response trailers
- Limits and timeouts in `KestrelServerLimits` are not enforced on HTTP/2
- HPACK use is very limited on the send side
  - Literals are not Huffman-encoded
  - Common headers (e.g. "server: Kestrel") are never indexed
- Honoring client settings
- Some error checking is still missing (e.g. validating incoming frame size)
2017-08-16 10:04:44 -07:00
Nate McMaster c10ac85cf2 Add fixes for problems discovered by xunit.analyzers (#1999)
* Add fixes to tests for problems discovered by xunit.analyzers 0.6.1

* PR feedback. Add comments about why we have a #pragma
2017-08-16 09:37:49 -07:00
David Fowler 5c775073a4 Initial bedrock refactoring (#1995)
- Added Protocols.Abstractions
 - IConnectionHandler.OnConnection takes an IFeatureCollection instead of
 IConnectionInfo
 - Removed IConnectionContext and IConnectionInformation replaced with
 IConnectionTransportFeature
 - Updated FrameConnectionContext and FrameContext to have the relevant
 state instead of flowing the ConnectionInformation.
 - Updated tests
2017-08-16 00:02:48 -07:00
Nate McMaster d3cf0494e7 Upgrade to xunit 2.3.0-beta3 2017-08-11 17:22:40 -07:00
Stephen Halter 02028b65c7 Stop using ConcurrentBag in tests for complex types (#1990)
dotnet/corefx#23068
2017-08-11 16:30:03 -07:00
Nate McMaster d3fb5e76f1 Remove dependency on a custom task to detect when compiling on macOS (#1987)
MSBuild.IsOSPlatform is new to MSBuild 15.3 and can be used to determine when we are building on macOS.
2017-08-09 16:48:02 -07:00
Pavel Krymets 659fa967a1 Consume corefxlab packages and private build of C# compiler (#1976) 2017-08-07 13:58:19 -07:00
Cesar Blum Silveira d68f8165e1 Disable test ConnectionClosedWhenResponseDoesNotSatisfyMinimumDataRate on Linux. 2017-08-04 17:45:07 -07:00
Nate McMaster 6584a8b5fd Shorten folder names
Remove the Microsoft.AspNetCore.Server prefix from csproj and their folders. This is required to help us avoid max path issues on Windows.
2017-07-28 11:11:55 -07:00
Pavel Krymets fd6617d101 React to pipeline changes (#1969) 2017-07-26 15:51:06 -07:00
Stephen Halter ecb26d9bbc Reenable a connection adapter test on TeamCity (#1961)
- Add more tracing to help diagnose failures if they pop up again
2017-07-19 15:26:29 -07:00
Stephen Halter 09c92d61d0 Merge branch 'rel/2.0.0' into dev 2017-07-17 14:58:16 -07:00
Stephen Halter f0e572075b Fix FlushAsync when a ConnectionAdapter is configured (#1957)
* Also remove async void everywhere
2017-07-17 14:57:26 -07:00
David Fowler 7ebbdad974 Add support for connection scopes if logging is enabled (#1953)
* Add support for connection scopes if logging is enabled
- Don't create a scope if logging isn't on
- Copied the pattern we use in Hosting
2017-07-12 11:45:08 -07:00
Cesar Blum Silveira fd1758fdfc Make StopAsync multi-thread safe (#1666). 2017-07-11 14:29:50 -07:00
Cesar Blum Silveira b0dc76a6ae Fix flakiness in RejectsRequestWithContentLengthAndUpgrade (#1742). 2017-07-11 12:59:29 -07:00
Cesar Blum Silveira 6e70b1bcca Fix flakiness in MaxRequestBufferSizeTests.LargeUpload (#1850). 2017-07-10 15:12:01 -07:00
Cesar Blum Silveira eca4bfe6c3 Add response minimum data rate feature. 2017-07-07 22:37:25 -07:00
Nate McMaster ec72c255f6 Make HttpsConnectionAdapter pubternal 2017-07-07 14:23:34 -07:00
Nate McMaster a3c157cb61 Validate certificate EKU when it is provided 2017-07-07 11:31:06 -07:00
Nate McMaster eea0c6490e Fix flaky test: ConnectionResetMidRequestIsLoggedAsDebug (#1933) 2017-07-03 11:37:23 -07:00
Aristarkh Zagorodnikov 00d17dea79 Domain socket handles (#1922)
* UvPipeHandle.Open(IntPtr) and underlying interop
* LibuvConstants.ENOTSUP
* IEndpointInformation.HandleType along with ListenOptions extra ctor and handle type re-specification
* Exception-based auto-detection of socket type in Listener, accept socket creation support for detected handle types in ListenerContext
* Added systemd Unix socket activation tests
2017-07-03 11:11:23 -07:00
Stephen Halter e9ffcdb414 Add feature to optionally disallow synchronous IO (#1919)
* Allow synchronous IO by default
2017-07-03 11:07:17 -07:00
Aristarkh Zagorodnikov 6e45de2205 Improved systemd activation tests (#1930)
* Added BASE_PORT envvar for SampleApp to allow for multiple instances to coexist

* Moved to systemd-socket-activate for activation tests

* Style fixes
2017-07-02 21:06:13 -07:00
Cesar Blum Silveira 81c2b57dda Increase default request min rate to 240 bytes/second (#1929). 2017-06-30 14:58:44 -07:00
Cesar Blum Silveira f2061ed716 Rename request body min rate APIs (#1901). 2017-06-29 17:16:34 -07:00
Stephen Halter 3ba8c2d3f0 Add ListenHandleTests (#1923) 2017-06-29 11:50:21 -07:00
Aristarkh Zagorodnikov a247a3d8e6 Attempting to fix systemd activation with minimal changes (#1925) 2017-06-29 11:01:03 -07:00
Nate McMaster 9b4be69e9d Do not enforce timeouts when the debugger is attached 2017-06-27 16:56:27 -07:00
Cesar Blum Silveira 3084227314 React to Testing#280. 2017-06-23 16:47:50 -07:00
Stephen Halter ea2f1033d3 Make Transport.Abstractions pubternal (#1911)
* Remove Sockets transport dependency from primary package
* Use deprecated travis images to keep systemd tests running

https://blog.travis-ci.com/2017-06-21-trusty-updates-2017-Q2-launch
2017-06-21 14:58:57 -07:00
Stephen Halter e1e7c9b810 Wait until the writer is complete to reset RequestBodyPipe (#1902) 2017-06-20 10:56:23 -07:00
Cesar Blum Silveira 892de7d4b8 Merge branch 'rel/2.0.0-preview2' into dev 2017-06-19 16:39:00 -07:00
Cesar Blum Silveira 7afd279a6d Don't pause and resume read timing on upgrade requests (#1904). 2017-06-19 16:37:47 -07:00
Stephen Halter d879518a18 Always complete RequestBodyPipe.Reader (#1893)
* Disable test that leaks blocks in debug builds
* Move some test helpers
2017-06-12 11:11:40 -07:00
Cesar Blum Silveira 48638cb1cd Merge branch 'rel/2.0.0-preview2' into dev 2017-06-08 15:01:34 -07:00
Cesar Blum Silveira fcc04f8c3d Add request body minimum data rate feature (#1874). 2017-06-08 14:36:03 -07:00
Pranav K 3f771ef0bc Remove usage of TaskCache (#1889)
* Remove usage of TaskCache
2017-06-08 13:47:01 -07:00
Stephen Halter f96c48c08d Add a request body size limit (#1877)
- Implement IHttpMaxRequestBodySizeFeature
2017-06-07 11:48:56 -07:00
Hao Kung 0390779084 Revert " #1875 Add Configuration support and tests."
This reverts commit c6e228d176.
2017-06-05 13:48:38 -07:00
Chris R c6e228d176 #1875 Add Configuration support and tests. 2017-06-02 12:30:12 -07:00
Pavel Krymets 3c731ceb13 React to logging in DI changes (#1873) 2017-06-02 08:34:22 -07:00
Nate McMaster a334e88597 Decrease connections used in ConnectionCountingReturnsToZero for slow test agents (#1872) 2017-05-30 14:16:07 -07:00
Nate McMaster c343628926 Implement max connection limits
- Added new options to allow configuring the maximum number of concurrent connections and upgraded connections.
- `KestrelServerLimits.MaxConcurrentConnections` defaults unlimited.
- `KestrelServerLimits.MaxConcurrentUpgradedConnections` defaults to unlimited.
- Calls to IHttpUpgradeFeature.UpgradeAsync() will throw when the MaxConcurrentUpgradedConnections limit has been reached.
- Kestrel will close new connections without response when MaxConcurrentConnections is reached.
2017-05-26 12:27:48 -07:00
Cesar Blum Silveira 009759c7f6 Fix broken microbenchmarks (#1861). 2017-05-25 16:01:17 -07:00
Stephen Halter 6c0af445e5 Fix flaky test and improve TestServer (#1859) 2017-05-24 15:45:54 -07:00
Cesar Blum Silveira 197eb43d8a Read request body concurrent to app execution. 2017-05-22 12:23:02 -07:00
Nate McMaster 390582dcf1 Target .NET Standard 2.0 (#1849) 2017-05-20 10:37:35 -07:00
Pavel Krymets 34ab089e7b React to scheduler changes (#1846) 2017-05-18 14:49:48 -07:00
Cesar Blum Silveira f8a6433cd5 Fix flaky ResponseTests.FailedWritesResultInAbortedRequest. 2017-05-17 17:01:34 -07:00