Commit Graph

1606 Commits

Author SHA1 Message Date
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
Vladimir Sadov f0ade24cf7 Updating to new toolset compiler. (#2043)
* Updating to new toolset compiler.
Now includes ref escaping rules.

* newer version.
2017-09-06 15:52:47 -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
Ben Adams e7743cbb78 Shorter LibuvThread locks (#2034) 2017-08-29 12:21:45 -07:00
Damir Ainullin 5bf7d3b28a Fix typo in FrameTests (#2033) 2017-08-27 20:11:00 -07:00
David Fowler 9d8556e7c4 Added FrameConnection.OnConnectionClosed back (#2028) 2017-08-26 21:20:06 -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
Ben Adams 09be7c416a Use preparsed version, rather than reparsing (#2021)
Current path is:

 Parser -> HttpVersion Enum -> Get Version String -> Set `HttpVersion` with string -> Convert back to Enum

Can just set the enum directly since its already parsed.

Also using the const rather than strings; where the strings are in code
2017-08-26 17:18:16 -07:00
Ben Adams 088f7e32ae Reset StatusCode & ReasonPhrase directly (#2025) 2017-08-26 17:14:45 -07:00
Nate McMaster 4735154ecd Install .NET Core 1.1.2 2017-08-26 11:18:15 -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
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
Ben Adams 59b77bb357 Async Main samples (#2004) 2017-08-18 14:46:19 -07:00
Nate McMaster 7f23ff08ce React to changes in BenchmarkDotNet 0.10.9 (#2006)
* fixup! React to changes in BenchmarkDotNet 0.10.9
2017-08-18 10:57:48 -07:00
Stephen Halter fd66472b39 Get Kestrel.Performance working again 2017-08-17 17:00:46 -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 b613f44ccd Add packages to README
[ci skip]
2017-08-17 12:52:03 -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
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
Pranav K f3745608af Switch to v3 NuGet feed 2017-08-15 16:14:19 -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
John Luo 06d596102a Ensure fallback to curl after failed wget 2017-08-02 14:32:33 -07:00
John Luo cfce9dce6c Update __get_remote_file logic 2017-08-02 12:44:46 -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
Nate McMaster d64238e937 Fix syntax warning when running build.sh on older versions of bash
[ci skip]
2017-07-26 10:28:03 -07:00
Nate McMaster a88e43bc67 Update bootstrappers to use the compiled version of KoreBuild
[ci skip]
2017-07-25 16:33:07 -07:00
Pranav K 58bcca9509 Updating to InternalAspNetCoreSdkVersion 2.1.1-* 2017-07-25 15:13:48 -07:00
Ryan Brandenburg 7de0540228 Set AspNetCoreVersion 2017-07-24 17:57:01 -07:00
Ryan Brandenburg 94305530b1 2.0.0-rtm to 2.1.0-preview1 2017-07-24 12:31:23 -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
Mike Harder 165a0940f1 Merge remote-tracking branch 'origin/rel/2.0.0' into dev 2017-07-12 16:56:59 -07:00
Mike Harder 095230cb85 Update Newtonsoft.Json to 10.0.1 (#1958)
- Matches other repos
2017-07-12 16:55:47 -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