- Improve test reliability of tests verifying the RequestAborted token gets tripped
- Once the response body is completed, don't fire the token for that request even if it is accessed later on.
- 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.
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
- 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
* 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
* 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.
- 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
* Improve ConnectionLimitMiddleware and connection pipeline building
* Add IDecrementConcurrentConnectionCountFeature
* Flow connection features from connection middleware