Commit Graph

117 Commits

Author SHA1 Message Date
Stephen Halter 0aff4a0440
Handle client and server aborts differently from eachhother (#2612)
* Trace when app aborts connection
* Improve exception messages
* Always abort connection with ConnectionAbortedException
* Add ConnectionContext.Abort(Exception)
2018-06-01 14:42:30 -07:00
Stephen Halter a9d6cf13eb
Consistently handle connection resets (#2547) 2018-05-22 16:38:21 -07:00
Stephen Halter b040e33b1b Merge branch 'release/2.1' into dev 2018-05-10 23:47:51 -07:00
Stephen Halter da21fc89cf
Handle exception in SocketConnection.Shutdown() (#2562) 2018-05-10 23:39:06 -07:00
Stephen Halter e6a88c1b9c
Relieve response backpressure immediately when closing socket (#2557)
* Relieve response backpressure immediately when closing socket
2018-05-10 17:13:57 -07:00
Pavel Krymets 2f2a0047a1
React to pool cleanup (#2526) 2018-04-30 08:37:15 -07:00
John Luo 1655a8fd6d Disable writing to console if exceptions are expected 2018-04-23 14:48:15 -07:00
Chris Ross (ASP.NET) 333586d735 Clean up flaky MaxRequestBufferSize tests #2225 2018-04-17 09:11:17 -07:00
John Luo 2d51d23697 Add file logging to functional tests 2018-04-13 14:53:57 -07:00
Chris Ross (ASP.NET) 9ea2c50068 Add SNI support #2357 2018-04-04 12:49:29 -07:00
David Fowler e7d3b0c5f9
Remove KestrelThreadPool abstraction and replaced it with PipeScheduler (#2371) 2018-03-12 14:49:19 -07:00
Stephen Halter 06945ba81e Include exceptions when displaying test logs (#2346) 2018-02-24 16:51:57 -08:00
Mike Harder 4afaa386db
Remove unnecessary usings (#2326) 2018-02-16 14:04:16 -08:00
Alessio Franceschelli 9341f72b8d Consumes request before closing connection (#2314) 2018-02-14 11:46:13 -08:00
Stephen Halter 30a68dec49
Fix flakiness in address-in-use test (#2267)
* Increase test timeouts
* Use constant for default test timeout.
2018-01-24 17:42:49 -08:00
Stephen Halter f4d27e67bb
Improve server shutdown logic (#2247)
Ensure connections abort when they don't close gracefully.
2018-01-16 16:43:45 -08:00
Javier Calvarro Nelson e6bb551018 Adds support for loading the developer certificate from a pfx file
* If we can't find a developer certificate on the certificate store
  we will look for a developer certificate on the file system if a
  password has been specified for the Development certificate.
* We will look at ${APPDATA}/ASP.NET/https/<<AppName>>.pfx for windows
  and fallback to ${HOME}/.aspnet/https/<<AppName>>.pfx
* In case the password wasn't specified through configuration, the file
  is not found on the file system or can't be loaded, we won't
  do anything.
2018-01-12 16:32:06 -08:00
Chris Ross (ASP.NET) dfaf37cbba Implement config support #1290 #1879 #2016 #2166 #2167 #2188 2017-12-21 09:12:32 -08:00
Stephen Halter 668f8e3b4b
Lazily allocate protocol-specific connection objects (#2190)
* Refactor Http[12]?Connection
2017-12-04 15:59:12 -08:00
David Fowler b8a1c04ffb
Make the HttpParser a singleton (#2203)
- It's completely stateless so make it a singleton
- Fixed tests
2017-12-03 13:27:36 -08:00
Cesar Blum Silveira 8c4bdbcf6b Add "zero config" HTTPS support using local development certificate. (#2093) 2017-10-25 13:59:09 -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 da7bc24eec Add request parsing regression tests. 2017-09-13 14:49:45 -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
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
Stephen Halter 02028b65c7 Stop using ConcurrentBag in tests for complex types (#1990)
dotnet/corefx#23068
2017-08-11 16:30:03 -07:00
Pavel Krymets 659fa967a1 Consume corefxlab packages and private build of C# compiler (#1976) 2017-08-07 13:58:19 -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 eca4bfe6c3 Add response minimum data rate feature. 2017-07-07 22:37:25 -07:00
Nate McMaster a3c157cb61 Validate certificate EKU when it is provided 2017-07-07 11:31:06 -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
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
Pavel Krymets 3c731ceb13 React to logging in DI changes (#1873) 2017-06-02 08:34:22 -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
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
Cesar Blum Silveira 37f15bdd85 Create Frame in FrameConnection. 2017-05-10 16:48:37 -07:00
David Fowler b9518e3684 Invert the dependency between connection adapters and Frame (#1822)
* Invert the dependency between connection adapters and Frame
- Removed PrepareRequest from IAdaptedConnection and instead added
a feature collection to the ConnectionAdapterContext. This allows features to be set
once by the adapter instead of per request. It's the Frame's job to copy features
from the connection level feature collection into the per request feature collection.
- Set the scheme to "https" based on the presence of ITlsConnectionFeature.
- Always set ITlsConnection feature if the HttpsAdaptedConnection doesn't throw during
the handshake
2017-05-10 15:29:43 -07:00
David Fowler c48113ad80 Refactoring and of FrameConnection and Frame (#1816)
* Refactoring and of FrameConnection and Frame
- Building on top of the last refactoring of FrameConnection, this change aims to clean up
the communication between the Frame and FrameConnection by removing some concepts and
being consistent about the communication between Frame and FrameConnection with or without
connection adapters. Changes include:
- Removing ConnectionLifetimeControl, ISocketOutput, StreamSocketOutput
- Moving more initialization of the frame to FrameConnection after the pipes
are setup
- OutputProducer communicates cancellation via the IPipeWriter instead of the output's IPipeReader.
- Frame always communicates via the pipes and that communications flows through the layers to the transport.
This means that each 1/2 of the adapted pipeline handles closing the right side of the transport at the
right time, propagating exceptions as necessary.
- This is how the flow looks now:
            ->                        ->
[transport]     [connection adapters]     [frame]
            <-                        <-
- Transports need to handle a ConnectionAbortedException on the output as a signal to stop
writing and end the connection. This will no longer try to drain the output but will just stop
writing and end the response immediately.
- Remove frame.Abort when cancellation on Write fails.
- Unify the connection shutdown logic
- Dispose 1/2 initialized connection adapters

#1815
2017-05-08 20:44:13 -07:00
Stephen Halter 6e2fdda162 Simplify connection lifetime control flow (#1776)
* Also make IAdaptedConnection disposable
2017-05-05 16:11:01 -07:00
Pavel Krymets 28b479c99a Merge branch 'rel/2.0.0-preview1' into dev 2017-05-05 14:35:41 -07:00
Pavel Krymets a9c165e666 netcoreapp2.0 (#1810) 2017-05-05 14:31:34 -07:00
David Fowler b21f84543a Use WebHostBuilder as an implementation detail of TestServer (#1804)
- This will make tests run more similarly so we can swap out the
transport more easily.
2017-05-03 19:35:09 -07:00
David Fowler 0755495ce5 Remove Logging dependency from the http parser (#1780)
* Remove Logging dependency from the http parser
2017-04-27 08:46:08 -07:00