Commit Graph

752 Commits

Author SHA1 Message Date
Cesar Blum Silveira 3fbfba63f8 HTTP/2: implement 100-continue (#2106) 2017-10-18 16:31:50 -07:00
Cesar Blum Silveira d4f263acce Fix typos in project names. 2017-10-16 14:13:05 -07:00
Cesar Blum Silveira 9dfffd14bb HTTP/2: support trailers. 2017-10-12 17:26:20 -07:00
Stephen Halter 66a3c9496a Set SO_REUSEADDR on managed listen sockets on Unix (#2111)
- https://github.com/dotnet/corefx/issues/24562
2017-10-12 12:26:52 -07:00
Cesar Blum Silveira deed6c9780 HTTP/2: add exception error messages and log them. 2017-10-12 11:23:57 -07:00
Stephen Halter fdb4184dbf Sockets transport (#2100)
* Make Sockets the default transport
* Create separate Libuv and Sockets functional test projects
* Fix functional tests that fail with Sockets
* Moved OneToTenThreads test to Kestrel.Transport.Libuv.Tests
* Fix systemd activation tests to use libuv transport
* Dispose Sockets PipeFactory
* Improve Socket's server-side abort handling
* Add explicit rebinding test
2017-10-11 15:14:35 -07:00
Cesar Blum Silveira d46d2ce193 HTTP/2: validate request headers prior to starting new stream. 2017-10-10 13:12:34 -07:00
Nate McMaster e2c22b91af Minor test code changes to resolve xUnit2013 build warning 2017-10-06 08:50:58 -07:00
Cesar Blum Silveira 11ce1395e5 HPACK fixes and improvements. 2017-10-04 12:59:41 -07:00
Stephen Halter 83e2084368 Fix flaky MaxRequestBodySizeTest (#2092)
- Don't attempt to send any data after the request might already be rejected.
2017-10-03 14:34:14 -07:00
Cesar Blum Silveira 1b1137b880 HTTP/2: connection error when receiving frames disallowed by stream states. 2017-10-02 10:24:57 -07:00
Cesar Blum Silveira bb9840a552 HTTP/2: do not ACK PING frames received with ACK set. 2017-09-29 16:40:01 -07:00
Cesar Blum Silveira 551c1ebc0b Configure enabled protocols per endpoint and add HTTP/2 w/ prior knowledge support (#2067). 2017-09-27 10:14:39 -07:00
Cesar Blum Silveira 343ce0f01b HTTP/2: close connection with PROTOCOL_ERROR when a stream depends on itself. 2017-09-22 16:35:12 -07:00
Cesar Blum Silveira e3533885a8 HTTP/2: close connection with PROTOCOL_ERROR when receiving a frame with an even stream ID. 2017-09-21 12:26:09 -07:00
Cesar Blum Silveira a4887f4caf HTTP/2: close connection with PROTOCOL_ERROR when receiving GOAWAY frame with non-zero stream ID. 2017-09-21 11:57:31 -07:00
Cesar Blum Silveira fc56552b2a HTTP/2: close connection on PING frame with non-zero stream ID. 2017-09-21 11:23:15 -07:00
Cesar Blum Silveira 555a881cb7 HTTP/2: close connection with PROTOCOL_ERROR when an unknown frame type is interleaved with headers. 2017-09-21 11:20:52 -07:00
Cesar Blum Silveira e2af346733 HTTP/2: close the connection with PROTOCOL_ERROR when a PUSH_PROMISE frame is received. 2017-09-21 11:20:33 -07:00
Cesar Blum Silveira 9944c0fd43 Fix reading DATA frames with maximum length. 2017-09-20 11:15:31 -07:00
Cesar Blum Silveira 91eb4cd54c Fix flakiness in KeepAliveTimeoutTests.ConnectionKeptAliveBetweenRequests (#1684). 2017-09-18 15:12:13 -07:00
Cesar Blum Silveira a31d1e024c Merge code paths duplicated between HTTP/1.x and HTTP/2 implementations (#2017).
- Most of the shared code is in the HttpProtocol class (former Frame)
- Virtual calls handle protocol-specific things
- Move the ProcessRequestsAsync loop to HttpProtocol
- Implement HTTP/1.x request processing in Http1Connection and HTTP/2
  in Http2Stream, with Http1Connection<T> and Http2Stream<T> subclassing
  those classes in order to handle the generic HttpContext parameter
- Split MessageBody into Http1MessageBody and Http2MessageBody,
  with MessageBody containing shared member variables and methods
2017-09-14 17:35:57 -07:00
Cesar Blum Silveira d28b413390 Add tracing to KeepAliveTimeoutTests.ConnectionKeptAliveBetweenRequests to investigate test failures. 2017-09-14 16:55:44 -07:00
Cesar Blum Silveira da7bc24eec Add request parsing regression tests. 2017-09-13 14:49:45 -07:00
Stephen Halter 1e465e9643 Improve timeout logic 2017-09-08 12:50:01 -07:00
Cesar Blum Silveira 66d8e8198d Re-enable TestKeepAliveTimeout. 2017-09-07 17:24:33 -07:00
Stephen Halter 284367db9f Improve ConnectionLimitMiddleware and connection pipeline building (#2010)
* Improve ConnectionLimitMiddleware and connection pipeline building
* Add IDecrementConcurrentConnectionCountFeature
* Flow connection features from connection middleware
2017-08-30 11:30:20 -07:00
Damir Ainullin 5bf7d3b28a Fix typo in FrameTests (#2033) 2017-08-27 20:11:00 -07:00
David Fowler 7854c0604a Remove the events on ConnectionContext (#2023)
- Use the pipe events and removed the Tasks from ConnectionContext
- Remove OnConnectionClosed from FrameConnection. Since the `FrameConnetion` is a single middleware, not the entire pipeline, we shouldn't need to wait on the connection close there.
- It seems like the callbacks are rooted on the pipe even after they fire. This needs to be investigated in pipelines.
2017-08-26 20:19:55 -07:00
Cesar Blum Silveira a145734d43 Fix flakiness in ConnectionClosedWhenResponseDoesNotSatisfyMinimumDataRate (#1955). 2017-08-24 10:17:05 -07:00
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
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
Ben Adams 442ee80039 Less awaits for Reponse Write(Async) 2017-08-17 15:51:22 -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
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