Commit Graph

1046 Commits

Author SHA1 Message Date
David Fowler dc9ed60465 Create the connection logging scope in ConnectionHandler (#2013)
- Instead of doing it on the FrameConnection only. This will
make sure all middleware logs get the connection id as part of their scope.
2017-08-22 14:32:58 -07:00
Ben Adams 11a9b6498d Don't alloc IEnumerable in Reset for ITlsConnectionFeature (#2009)
* Don't alloc IEnumerable for ITlsConnectionFeature
* Delegate to ConnectionFeatures and determine scheme once
2017-08-21 17:01:05 -07:00
David Fowler 2e6687031d Added initial connection middleware pipeline (#2003)
* Added initial connection middleware pipeline
- Implemented IConnectionBuilder on ListenOptions. Kept IConnectionAdapter for now.
- Delay the configure callback for ListenOptions until the server has started.
- Added ConnectionLimitMiddleware and HttpConnectionMiddleware
- Expose ConnectionAborted and ConnectionClosed on ConnectionContext and
IConnectionTransportFeature
- Updated the tests
- Removed IConnectionApplicationFeature
- Moved Application to IConnectionTransportFeature
2017-08-21 12:11:27 -07:00
Stephen Halter 14f122fb9f Measure Writing in FrameWritingBenchmark 2017-08-17 16:59:24 -07:00
Ben Adams 442ee80039 Less awaits for Reponse Write(Async) 2017-08-17 15:51:22 -07:00
Nate McMaster 87db7cceb6 Stop producing Microsoft.AspNetCore.Server.Kestrel.Tls as a package 2017-08-16 14:56:01 -07:00
Nate McMaster 26f1d4baa3 Use PackageLineup
PackageLineup is a way to manage PackageReference versions across large projects. It removes the version information from the repository and instead pulls the information from an external "lineup" file.
2017-08-16 14:10:43 -07:00
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
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
Pavel Krymets 659fa967a1 Consume corefxlab packages and private build of C# compiler (#1976) 2017-08-07 13:58:19 -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 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 eca4bfe6c3 Add response minimum data rate feature. 2017-07-07 22:37:25 -07:00
Nate McMaster 5185ebe45f Fix typo in type name (#1948) 2017-07-07 16:27:20 -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 bd8a2c8a62 Add XML docs for the public HTTPs APIs shipping in 2.0 (#1942) 2017-07-07 10:40:39 -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
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 68ba9a9445 Avoid torn reads from _frame.MinReadBodyDataRate in FrameConnection.Tick(). 2017-06-30 12:22:31 -07:00
Cesar Blum Silveira f2061ed716 Rename request body min rate APIs (#1901). 2017-06-29 17:16:34 -07:00
Nate McMaster 9b4be69e9d Do not enforce timeouts when the debugger is attached 2017-06-27 16:56:27 -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 a97c08843c Complete IPipeWriter in OutputProducer.Abort() (#1894)
- This prevents MemoryPoolBlocks from leaking when writes fail
2017-06-12 11:12:01 -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
Stephen Halter 31e5dfdcf0 Merge branch 'rel/2.0.0-preview2' into dev 2017-06-08 15:09:55 -07:00
Stephen Halter f67a105ff4 Update defaults in KestrelServerLimits doc comments (#1891) 2017-06-08 15:08:49 -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
Cesar Blum Silveira 402b337178 Temporary workaround for GenerateResource task error on VS. 2017-05-30 12:47:36 -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 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
Nate McMaster 7f0319f5dd Throw InvalidOperationException from IHttpUpgradeFeature.UpgradeAsync when request is not upgradable 2017-05-17 11:38:42 -07:00
Pavel Krymets d22f689fd2 Add support to use System.Memory as a package instead of internilized source (#1821) 2017-05-16 16:54:03 -07:00
David Fowler cf16d601d6 Remove synchronous Write APIs (#1838) 2017-05-15 19:04:04 -07:00
Stephen Halter 9ab09dbe48 Change Exception to UvException where possible (#1833) 2017-05-15 11:03:04 -07:00