Commit Graph

138 Commits

Author SHA1 Message Date
Simon Cropp d4ab8b27a9 typos, inline outs, redundant usings (#2965) 2018-09-28 11:14:59 -07:00
Stephen Halter e9c2acf4dc
Add HTTP/2 response draining timeout (#2956)
* Move drain timeout to Http1Connection
* Add TimeoutControl class
2018-09-27 17:59:12 -07:00
Stephen Halter f3b6430aab
Initialize Heartbeat in KestrelServer.StartAsync (#2939)
Fixes #2850 again
2018-09-17 16:43:30 -07:00
Stephen Halter f47aa1283e
Make usage of TestConnection.Receive vs ReceiveEnd consistent (#2896)
- Add a transport test verifying that concurrent requests/connections work.
2018-09-07 18:09:51 -07:00
Simon Cropp d3d7c55198 fix some spelling (#2888) 2018-09-06 11:48:25 -07:00
Stephen Halter f70ba53253
Fix race when SystemClock is accessed before first heartbeat (#2851) 2018-08-27 10:59:29 -07:00
Stephen Halter e5a1101239
Improve exception handling in SocketConnection (#2844)
- Avoid race where a connection reset observed by both DoSend() and DoReceive()
  resulted in a ConnectionAbortedException being thrown from the input Pipe
  instead of a ConnectionResetException.
2018-08-23 16:59:02 -07:00
David Fowler 68a0863524
General connection management (#2834)
This change makes the handling of graceful shutdown work for more than just http scenarios. This should allow us to move TLS further out and should also allow us to start moving things to connection middleware instead of connection adapters.
Summary of the things changed/added:
- Added IConnectionLifetimeNotificationFeature that represents an attempt to gracefully close the connection that isn't being aborted. This feels pretty awful but we may have to do it.
- Moved connection management to the ConnectionDispatcher and out of the HttpConnectionMiddleware
- Removed Http from the names of the ConnectionManager and Heartbeat
2018-08-22 20:35:28 -07:00
Stephen Halter 5becb72107
Improve test logs (#2826)
- Include hosting logs in some tests that where previously missing them
- Prevent duplicate logs from Mock CallBase an CompositeKestrelTrace
- Log ports used by transport functional tests
- Add file logging to HTTP/2 "unit" tests
2018-08-15 18:31:56 -07:00
Chris Ross (ASP.NET) c73d513289 Add Http2 frame logging 2018-08-08 09:46:42 -07:00
John Luo 0a28806c17 Fix flaky graceful shutdown tests 2018-08-07 15:40:38 -07:00
Stephen Halter 0e99235d59
Add in-memory functional test project (#2780)
- Run AddressRegistrationTests independently to avoid port conflicts
- Only run tests that verify transport behavior for each transport
2018-08-07 15:34:11 -07:00
John Luo 8a74cf3ed5 Gracefully shutdown HTTP/2 connections on server and client initiated shutdown 2018-08-07 10:59:29 -07:00
Chris Ross (ASP.NET) beca0259c2 Verify request Content-Length #2733 2018-08-02 13:23:57 -07:00
Chris Ross (ASP.NET) 612fcca729 Validate Http/2 pseudo headers #2205 #2263 #2659 2018-07-19 16:25:10 -07:00
John Luo 6551eae321 Consolidate HTTP charset validation logic 2018-07-13 16:47:28 -07:00
Stephen Halter 864cfeb2aa Merge branch 'release/2.1' into release/2.2 2018-07-12 11:18:41 -07:00
Nate McMaster 181e521b40
Fix compiler error as a result of merging 2.1.2 into release/2.1 2018-07-10 12:37:07 -07:00
Stephen Halter ac31e5ab30
[2.1.3] Consistently handle connection aborts (#2619)
* Decouple connection objects from the server (#2535)

- Making progress towards being able to use the connection objects on the client side.

* Wait for input writer to complete before calling OnConnectionClosed (#2566)

* Wait for the ConnectionClosed token to stop tracking connections (#2574)

- The prior strategy of waiting for the pipe completed callbacks doesn't work
  because blocks are returned to the memory pool after the callbacks are fired.

* Consistently handle connection resets (#2547)

* Provide better connection abort exceptions and logs

* void IConnectionDispatcher.OnConnection
2018-06-28 10:51:22 -07:00
Chris Ross (ASP.NET) 00827e38bb Harden TFM checks #2624 2018-06-07 14:56:23 -07:00
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 b08163d3b7
[2.1.1] Use TaskCreationOptions.RunContinuationsAsynchronously a lot (#2618) 2018-05-29 16:07:41 -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