- Making MemoryPoolBlock.End volatile and using Volatile.Write for
MemoryPoolBlock.Next prevents a race that could cause threads consuming
blocks to skip produced bytes.
- For the purposes of this commit, control characters are everything < 0x20.
- Immediately throw an InvalidOperationException when the header is added to
the IHttpResponseFeature.Headers dictionary.
- Change most tests to use dynamic ports, rather than a fixed port obtained from GetNextPort().
- Add several new cases to `AddressRegistrationTests` and `ServerAddressFacts`.
- Remove project `test\Microsoft.AspNetCore.Server.Kestrel.TestCommon`. It's not longer needed, since only `AddressRegistrationTests` uses `GetNextPort()`.
- Unsupported members should throw NotSupportedException instead of
NotImplementedException per MSDN docs for CanRead/CanSeek/CanWrite.
- Position should throw NotSupportedException when CanSeek is false.
- FrameRequestStream.Flush/FlushAsync should not throw
NotImplementedException.
- Use expression-bodied members for CanRead/CanSeek/CanWrite on
FrameRequestStream to match FrameResponseStream.
- Provide no-op override of LibuvStream.FlushAsync to match Flush.
- If we're done before the client sends a FIN, force a FIN into the raw
SocketInput so the task in FileteredStreamAdapter finishes gracefully
and we dispose everything in proper order.
- If there's an error while writing to a stream (like ObjectDisposedException),
log it once and prevent further write attempts. This means the client closed
the connection while we were still writing output.
- This also fixes a bug related to the point above, where memory blocks were
being leaked instead of returned to the pool (because we weren't catching
the exception from Write()).