Make Kestrels Internals truly internal. (#8517)

This commit is contained in:
Justin Kotalik 2019-03-18 10:15:39 -07:00 committed by GitHub
parent 5c6e1aa1d9
commit a3c8bd16f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
218 changed files with 664 additions and 2662 deletions

View File

@ -5,14 +5,13 @@ using System;
using System.IO; using System.IO;
using System.IO.Pipelines; using System.IO.Pipelines;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
{ {
public class AdaptedPipeline : IDuplexPipe internal class AdaptedPipeline : IDuplexPipe
{ {
private static readonly int MinAllocBufferSize = KestrelMemoryPool.MinimumSegmentSize / 2; private static readonly int MinAllocBufferSize = KestrelMemoryPool.MinimumSegmentSize / 2;

View File

@ -8,7 +8,7 @@ using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
{ {
public class LoggingConnectionAdapter : IConnectionAdapter internal class LoggingConnectionAdapter : IConnectionAdapter
{ {
private readonly ILogger _logger; private readonly ILogger _logger;

View File

@ -10,7 +10,7 @@ using System.Buffers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal namespace Microsoft.AspNetCore.Server.Kestrel.Core.Adapter.Internal
{ {
public class RawStream : Stream internal class RawStream : Stream
{ {
private readonly PipeReader _input; private readonly PipeReader _input;
private readonly PipeWriter _output; private readonly PipeWriter _output;

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics; using System.Diagnostics;
@ -42,10 +42,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core
} }
[StackTraceHidden] [StackTraceHidden]
#pragma warning disable PUB0001 // Pubternal type in public API internal static void Throw(RequestRejectionReason reason, HttpMethod method)
public static void Throw(RequestRejectionReason reason, HttpMethod method)
=> throw GetException(reason, method.ToString().ToUpperInvariant()); => throw GetException(reason, method.ToString().ToUpperInvariant());
#pragma warning restore PUB0001 // Pubternal type in public API
[MethodImpl(MethodImplOptions.NoInlining)] [MethodImpl(MethodImplOptions.NoInlining)]
internal static BadHttpRequestException GetException(RequestRejectionReason reason) internal static BadHttpRequestException GetException(RequestRejectionReason reason)

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
@ -13,7 +13,7 @@ using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal
{ {
public class ConnectionDispatcher : IConnectionDispatcher internal class ConnectionDispatcher : IConnectionDispatcher
{ {
private static long _lastConnectionId = long.MinValue; private static long _lastConnectionId = long.MinValue;

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks; using System.Threading.Tasks;
@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal
{ {
public class ConnectionLimitMiddleware internal class ConnectionLimitMiddleware
{ {
private readonly ConnectionDelegate _next; private readonly ConnectionDelegate _next;
private readonly ResourceCounter _concurrentConnectionCounter; private readonly ResourceCounter _concurrentConnectionCounter;

View File

@ -8,7 +8,7 @@ using System.Globalization;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal
{ {
public class ConnectionLogScope : IReadOnlyList<KeyValuePair<string, object>> internal class ConnectionLogScope : IReadOnlyList<KeyValuePair<string, object>>
{ {
private readonly string _connectionId; private readonly string _connectionId;

View File

@ -1,4 +1,7 @@
namespace System.IO.Pipelines // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace System.IO.Pipelines
{ {
internal class DuplexPipe : IDuplexPipe internal class DuplexPipe : IDuplexPipe
{ {

View File

@ -6,7 +6,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
[Flags] [Flags]
public enum ConnectionOptions internal enum ConnectionOptions
{ {
None = 0, None = 0,
Close = 1, Close = 1,

View File

@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
/// <summary> /// <summary>
/// Manages the generation of the date header value. /// Manages the generation of the date header value.
/// </summary> /// </summary>
public class DateHeaderValueManager : IHeartbeatHandler internal class DateHeaderValueManager : IHeartbeatHandler
{ {
private static readonly byte[] _datePreambleBytes = Encoding.ASCII.GetBytes("\r\nDate: "); private static readonly byte[] _datePreambleBytes = Encoding.ASCII.GetBytes("\r\nDate: ");

View File

@ -9,7 +9,6 @@ using System.IO.Pipelines;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal; using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
@ -17,7 +16,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
/// <summary> /// <summary>
/// http://tools.ietf.org/html/rfc2616#section-3.6.1 /// http://tools.ietf.org/html/rfc2616#section-3.6.1
/// </summary> /// </summary>
public class Http1ChunkedEncodingMessageBody : Http1MessageBody internal class Http1ChunkedEncodingMessageBody : Http1MessageBody
{ {
// byte consts don't have a data type annotation so we pre-cast it // byte consts don't have a data type annotation so we pre-cast it
private const byte ByteCR = (byte)'\r'; private const byte ByteCR = (byte)'\r';

View File

@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Features;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public partial class Http1Connection : IHttpMinRequestBodyDataRateFeature, internal partial class Http1Connection : IHttpMinRequestBodyDataRateFeature,
IHttpMinResponseDataRateFeature IHttpMinResponseDataRateFeature
{ {
MinDataRate IHttpMinRequestBodyDataRateFeature.MinDataRate MinDataRate IHttpMinRequestBodyDataRateFeature.MinDataRate

View File

@ -11,11 +11,10 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Connections; using Microsoft.AspNetCore.Connections;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure; using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public partial class Http1Connection : HttpProtocol, IRequestProcessor internal partial class Http1Connection : HttpProtocol, IRequestProcessor
{ {
private const byte ByteAsterisk = (byte)'*'; private const byte ByteAsterisk = (byte)'*';
private const byte ByteForwardSlash = (byte)'/'; private const byte ByteForwardSlash = (byte)'/';

View File

@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Connections;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public class Http1ContentLengthMessageBody : Http1MessageBody internal class Http1ContentLengthMessageBody : Http1MessageBody
{ {
private readonly long _contentLength; private readonly long _contentLength;
private long _inputLength; private long _inputLength;

View File

@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public abstract class Http1MessageBody : MessageBody internal abstract class Http1MessageBody : MessageBody
{ {
protected readonly Http1Connection _context; protected readonly Http1Connection _context;

View File

@ -15,7 +15,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public class Http1OutputProducer : IHttpOutputProducer, IHttpOutputAborter, IDisposable internal class Http1OutputProducer : IHttpOutputProducer, IHttpOutputAborter, IDisposable
{ {
// Use C#7.3's ReadOnlySpan<byte> optimization for static data https://vcsjones.com/2019/02/01/csharp-readonly-span-bytes-static/ // Use C#7.3's ReadOnlySpan<byte> optimization for static data https://vcsjones.com/2019/02/01/csharp-readonly-span-bytes-static/
// "HTTP/1.1 100 Continue\r\n\r\n" // "HTTP/1.1 100 Continue\r\n\r\n"

View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public readonly struct Http1ParsingHandler : IHttpRequestLineHandler, IHttpHeadersHandler internal readonly struct Http1ParsingHandler : IHttpRequestLineHandler, IHttpHeadersHandler
{ {
public readonly Http1Connection Connection; public readonly Http1Connection Connection;

View File

@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
/// The upgrade stream uses the raw connection stream instead of going through the RequestBodyPipe. This /// The upgrade stream uses the raw connection stream instead of going through the RequestBodyPipe. This
/// removes the redundant copy from the transport pipe to the body pipe. /// removes the redundant copy from the transport pipe to the body pipe.
/// </summary> /// </summary>
public class Http1UpgradeMessageBody : Http1MessageBody internal class Http1UpgradeMessageBody : Http1MessageBody
{ {
public bool _completed; public bool _completed;
public Http1UpgradeMessageBody(Http1Connection context) public Http1UpgradeMessageBody(Http1Connection context)

View File

@ -12,7 +12,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public partial class HttpRequestHeaders internal partial class HttpRequestHeaders
{ {
private long _bits = 0; private long _bits = 0;
@ -4705,7 +4705,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
} }
} }
public partial class HttpResponseHeaders internal partial class HttpResponseHeaders
{ {
private static ReadOnlySpan<byte> HeaderBytes => new byte[] private static ReadOnlySpan<byte> HeaderBytes => new byte[]
{ {
@ -8531,7 +8531,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
} }
} }
public partial class HttpResponseTrailers internal partial class HttpResponseTrailers
{ {
private static ReadOnlySpan<byte> HeaderBytes => new byte[] private static ReadOnlySpan<byte> HeaderBytes => new byte[]
{ {

View File

@ -14,7 +14,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public abstract class HttpHeaders : IHeaderDictionary internal abstract class HttpHeaders : IHeaderDictionary
{ {
protected long? _contentLength; protected long? _contentLength;
protected bool _isReadOnly; protected bool _isReadOnly;

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public enum HttpMethod: byte internal enum HttpMethod: byte
{ {
Get, Get,
Put, Put,

View File

@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public class HttpParser<TRequestHandler> : IHttpParser<TRequestHandler> where TRequestHandler : IHttpHeadersHandler, IHttpRequestLineHandler internal class HttpParser<TRequestHandler> : IHttpParser<TRequestHandler> where TRequestHandler : IHttpHeadersHandler, IHttpRequestLineHandler
{ {
private bool _showErrorDetails; private bool _showErrorDetails;

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.IO.Pipelines; using System.IO.Pipelines;
using System.Net; using System.Net;
@ -17,7 +16,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public partial class HttpProtocol : IHttpRequestFeature, internal partial class HttpProtocol : IHttpRequestFeature,
IHttpResponseFeature, IHttpResponseFeature,
IResponseBodyPipeFeature, IResponseBodyPipeFeature,
IRequestBodyPipeFeature, IRequestBodyPipeFeature,

View File

@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Features;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public partial class HttpProtocol : IFeatureCollection internal partial class HttpProtocol : IFeatureCollection
{ {
private static readonly Type IHttpRequestFeatureType = typeof(IHttpRequestFeature); private static readonly Type IHttpRequestFeatureType = typeof(IHttpRequestFeature);
private static readonly Type IHttpResponseFeatureType = typeof(IHttpResponseFeature); private static readonly Type IHttpResponseFeatureType = typeof(IHttpResponseFeature);

View File

@ -23,7 +23,7 @@ using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public abstract partial class HttpProtocol : IDefaultHttpContextContainer, IHttpResponseControl internal abstract partial class HttpProtocol : IDefaultHttpContextContainer, IHttpResponseControl
{ {
private static readonly byte[] _bytesConnectionClose = Encoding.ASCII.GetBytes("\r\nConnection: close"); private static readonly byte[] _bytesConnectionClose = Encoding.ASCII.GetBytes("\r\nConnection: close");
private static readonly byte[] _bytesConnectionKeepAlive = Encoding.ASCII.GetBytes("\r\nConnection: keep-alive"); private static readonly byte[] _bytesConnectionKeepAlive = Encoding.ASCII.GetBytes("\r\nConnection: keep-alive");

View File

@ -11,7 +11,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public sealed partial class HttpRequestHeaders : HttpHeaders internal sealed partial class HttpRequestHeaders : HttpHeaders
{ {
private static long ParseContentLength(string value) private static long ParseContentLength(string value)
{ {

View File

@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
/// <summary> /// <summary>
/// Default HttpRequest PipeReader implementation to be used by Kestrel. /// Default HttpRequest PipeReader implementation to be used by Kestrel.
/// </summary> /// </summary>
public class HttpRequestPipeReader : PipeReader internal class HttpRequestPipeReader : PipeReader
{ {
private MessageBody _body; private MessageBody _body;
private HttpStreamState _state; private HttpStreamState _state;

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public enum HttpRequestTarget internal enum HttpRequestTarget
{ {
Unknown = -1, Unknown = -1,
// origin-form is the most common // origin-form is the most common

View File

@ -12,7 +12,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public sealed partial class HttpResponseHeaders : HttpHeaders internal sealed partial class HttpResponseHeaders : HttpHeaders
{ {
private static ReadOnlySpan<byte> _CrLf => new[] { (byte)'\r', (byte)'\n' }; private static ReadOnlySpan<byte> _CrLf => new[] { (byte)'\r', (byte)'\n' };
private static ReadOnlySpan<byte> _colonSpace => new[] { (byte)':', (byte)' ' }; private static ReadOnlySpan<byte> _colonSpace => new[] { (byte)':', (byte)' ' };

View File

@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public class HttpResponsePipeWriter : PipeWriter internal class HttpResponsePipeWriter : PipeWriter
{ {
private HttpStreamState _state; private HttpStreamState _state;
private readonly IHttpResponseControl _pipeControl; private readonly IHttpResponseControl _pipeControl;

View File

@ -9,7 +9,7 @@ using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public partial class HttpResponseTrailers : HttpHeaders internal partial class HttpResponseTrailers : HttpHeaders
{ {
public Enumerator GetEnumerator() public Enumerator GetEnumerator()
{ {

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public enum HttpScheme internal enum HttpScheme
{ {
Unknown = -1, Unknown = -1,
Http = 0, Http = 0,

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
enum HttpStreamState internal enum HttpStreamState
{ {
Open, Open,
Closed, Closed,

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public enum HttpVersion internal enum HttpVersion
{ {
Unknown = -1, Unknown = -1,
Http10 = 0, Http10 = 0,

View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public interface IHttpHeadersHandler internal interface IHttpHeadersHandler
{ {
void OnHeader(Span<byte> name, Span<byte> value); void OnHeader(Span<byte> name, Span<byte> value);
} }

View File

@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Connections;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public interface IHttpOutputAborter internal interface IHttpOutputAborter
{ {
void Abort(ConnectionAbortedException abortReason); void Abort(ConnectionAbortedException abortReason);
} }

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public interface IHttpOutputProducer internal interface IHttpOutputProducer
{ {
ValueTask<FlushResult> WriteChunkAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken); ValueTask<FlushResult> WriteChunkAsync(ReadOnlySpan<byte> data, CancellationToken cancellationToken);
ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken); ValueTask<FlushResult> FlushAsync(CancellationToken cancellationToken);

View File

@ -6,7 +6,7 @@ using System.Buffers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public interface IHttpParser<TRequestHandler> where TRequestHandler : IHttpHeadersHandler, IHttpRequestLineHandler internal interface IHttpParser<TRequestHandler> where TRequestHandler : IHttpHeadersHandler, IHttpRequestLineHandler
{ {
bool ParseRequestLine(TRequestHandler handler, in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined); bool ParseRequestLine(TRequestHandler handler, in ReadOnlySequence<byte> buffer, out SequencePosition consumed, out SequencePosition examined);

View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public interface IHttpRequestLineHandler internal interface IHttpRequestLineHandler
{ {
void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded); void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded);
} }

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public interface IHttpResponseControl internal interface IHttpResponseControl
{ {
void ProduceContinue(); void ProduceContinue();
Memory<byte> GetMemory(int sizeHint = 0); Memory<byte> GetMemory(int sizeHint = 0);

View File

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public interface IHttpResponsePipeWriterControl internal interface IHttpResponsePipeWriterControl
{ {
void ProduceContinue(); void ProduceContinue();
Memory<byte> GetMemory(int sizeHint = 0); Memory<byte> GetMemory(int sizeHint = 0);

View File

@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public abstract class MessageBody internal abstract class MessageBody
{ {
private static readonly MessageBody _zeroContentLengthClose = new ZeroContentLengthMessageBody(keepAlive: false); private static readonly MessageBody _zeroContentLengthClose = new ZeroContentLengthMessageBody(keepAlive: false);
private static readonly MessageBody _zeroContentLengthKeepAlive = new ZeroContentLengthMessageBody(keepAlive: true); private static readonly MessageBody _zeroContentLengthKeepAlive = new ZeroContentLengthMessageBody(keepAlive: true);

View File

@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public static class PathNormalizer internal static class PathNormalizer
{ {
private const byte ByteSlash = (byte)'/'; private const byte ByteSlash = (byte)'/';
private const byte ByteDot = (byte)'.'; private const byte ByteDot = (byte)'.';

View File

@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public static class PipelineExtensions internal static class PipelineExtensions
{ {
private const int _maxULongByteLength = 20; private const int _maxULongByteLength = 20;

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public enum ProduceEndType internal enum ProduceEndType
{ {
SocketShutdown, SocketShutdown,
SocketDisconnect, SocketDisconnect,

View File

@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public static class ReasonPhrases internal static class ReasonPhrases
{ {
private static readonly byte[] _bytesStatus100 = CreateStatusBytes(StatusCodes.Status100Continue); private static readonly byte[] _bytesStatus100 = CreateStatusBytes(StatusCodes.Status100Continue);
private static readonly byte[] _bytesStatus101 = CreateStatusBytes(StatusCodes.Status101SwitchingProtocols); private static readonly byte[] _bytesStatus101 = CreateStatusBytes(StatusCodes.Status101SwitchingProtocols);

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public enum RequestProcessingStatus internal enum RequestProcessingStatus
{ {
RequestPending, RequestPending,
ParsingRequestLine, ParsingRequestLine,

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public enum RequestRejectionReason internal enum RequestRejectionReason
{ {
UnrecognizedHTTPVersion, UnrecognizedHTTPVersion,
InvalidRequestLine, InvalidRequestLine,

View File

@ -6,7 +6,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
[Flags] [Flags]
public enum TransferCoding internal enum TransferCoding
{ {
None, None,
Chunked, Chunked,

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{ {
public class ZeroContentLengthMessageBody : MessageBody internal class ZeroContentLengthMessageBody : MessageBody
{ {
public ZeroContentLengthMessageBody(bool keepAlive) public ZeroContentLengthMessageBody(bool keepAlive)
: base(null, null) : base(null, null)

View File

@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics; using System.Diagnostics;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl
{ {
public struct FlowControl internal struct FlowControl
{ {
public FlowControl(uint initialWindowSize) public FlowControl(uint initialWindowSize)
{ {

View File

@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics; using System.Diagnostics;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl
{ {
public class InputFlowControl internal class InputFlowControl
{ {
private readonly int _initialWindowSize; private readonly int _initialWindowSize;
private readonly int _minWindowSizeIncrement; private readonly int _minWindowSizeIncrement;

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic; using System.Collections.Generic;
@ -6,7 +6,7 @@ using System.Diagnostics;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl
{ {
public class OutputFlowControl internal class OutputFlowControl
{ {
private FlowControl _flow; private FlowControl _flow;
private Queue<OutputFlowControlAwaitable> _awaitableQueue; private Queue<OutputFlowControlAwaitable> _awaitableQueue;

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
@ -8,7 +8,7 @@ using System.Threading;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl
{ {
public class OutputFlowControlAwaitable : ICriticalNotifyCompletion internal class OutputFlowControlAwaitable : ICriticalNotifyCompletion
{ {
private static readonly Action _callbackCompleted = () => { }; private static readonly Action _callbackCompleted = () => { };

View File

@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics; using System.Diagnostics;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl
{ {
public class StreamInputFlowControl internal class StreamInputFlowControl
{ {
private readonly InputFlowControl _connectionLevelFlowControl; private readonly InputFlowControl _connectionLevelFlowControl;
private readonly InputFlowControl _streamLevelFlowControl; private readonly InputFlowControl _streamLevelFlowControl;

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
@ -7,7 +7,7 @@ using System.Runtime.CompilerServices;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl
{ {
public class StreamOutputFlowControl internal class StreamOutputFlowControl
{ {
private readonly OutputFlowControl _connectionLevelFlowControl; private readonly OutputFlowControl _connectionLevelFlowControl;
private readonly OutputFlowControl _streamLevelFlowControl; private readonly OutputFlowControl _streamLevelFlowControl;

View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public class DynamicTable internal class DynamicTable
{ {
private HeaderField[] _buffer; private HeaderField[] _buffer;
private int _maxSize; private int _maxSize;

View File

@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public class HPackDecoder internal class HPackDecoder
{ {
private enum State private enum State
{ {

View File

@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public class HPackDecodingException : Exception internal class HPackDecodingException : Exception
{ {
public HPackDecodingException(string message) public HPackDecodingException(string message)
: base(message) : base(message)

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public class HPackEncoder internal class HPackEncoder
{ {
private IEnumerator<KeyValuePair<string, string>> _enumerator; private IEnumerator<KeyValuePair<string, string>> _enumerator;

View File

@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public class HPackEncodingException : Exception internal class HPackEncodingException : Exception
{ {
public HPackEncodingException(string message) public HPackEncodingException(string message)
: base(message) : base(message)

View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public readonly struct HeaderField internal readonly struct HeaderField
{ {
// http://httpwg.org/specs/rfc7541.html#rfc.section.4.1 // http://httpwg.org/specs/rfc7541.html#rfc.section.4.1
public const int RfcOverhead = 32; public const int RfcOverhead = 32;

View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public class Huffman internal class Huffman
{ {
// TODO: this can be constructed from _decodingTable // TODO: this can be constructed from _decodingTable
private static readonly (uint code, int bitLength)[] _encodingTable = new (uint code, int bitLength)[] private static readonly (uint code, int bitLength)[] _encodingTable = new (uint code, int bitLength)[]

View File

@ -1,11 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public class HuffmanDecodingException : Exception internal class HuffmanDecodingException : Exception
{ {
public HuffmanDecodingException(string message) public HuffmanDecodingException(string message)
: base(message) : base(message)

View File

@ -6,7 +6,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
/// <summary> /// <summary>
/// The maximum we will decode is Int32.MaxValue, which is also the maximum request header field size. /// The maximum we will decode is Int32.MaxValue, which is also the maximum request header field size.
/// </summary> /// </summary>
public class IntegerDecoder internal class IntegerDecoder
{ {
private int _i; private int _i;
private int _m; private int _m;

View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public static class IntegerEncoder internal static class IntegerEncoder
{ {
public static bool Encode(int i, int n, Span<byte> buffer, out int length) public static bool Encode(int i, int n, Span<byte> buffer, out int length)
{ {

View File

@ -7,7 +7,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public class StaticTable internal class StaticTable
{ {
private static readonly StaticTable _instance = new StaticTable(); private static readonly StaticTable _instance = new StaticTable();

View File

@ -6,7 +6,7 @@ using System.Text;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.HPack
{ {
public static class StatusCodes internal static class StatusCodes
{ {
private static readonly byte[] _bytesStatus100 = CreateStatusBytes(Microsoft.AspNetCore.Http.StatusCodes.Status100Continue); private static readonly byte[] _bytesStatus100 = CreateStatusBytes(Microsoft.AspNetCore.Http.StatusCodes.Status100Continue);
private static readonly byte[] _bytesStatus101 = CreateStatusBytes(Microsoft.AspNetCore.Http.StatusCodes.Status101SwitchingProtocols); private static readonly byte[] _bytesStatus101 = CreateStatusBytes(Microsoft.AspNetCore.Http.StatusCodes.Status101SwitchingProtocols);

View File

@ -26,7 +26,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public class Http2Connection : IHttp2StreamLifetimeHandler, IHttpHeadersHandler, IRequestProcessor internal class Http2Connection : IHttp2StreamLifetimeHandler, IHttpHeadersHandler, IRequestProcessor
{ {
public static byte[] ClientPreface { get; } = Encoding.ASCII.GetBytes("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"); public static byte[] ClientPreface { get; } = Encoding.ASCII.GetBytes("PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n");

View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public class Http2ConnectionErrorException : Exception internal class Http2ConnectionErrorException : Exception
{ {
public Http2ConnectionErrorException(string message, Http2ErrorCode errorCode) public Http2ConnectionErrorException(string message, Http2ErrorCode errorCode)
: base($"HTTP/2 connection error ({errorCode}): {message}") : base($"HTTP/2 connection error ({errorCode}): {message}")

View File

@ -6,7 +6,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
[Flags] [Flags]
public enum Http2ContinuationFrameFlags : byte internal enum Http2ContinuationFrameFlags : byte
{ {
NONE = 0x0, NONE = 0x0,
END_HEADERS = 0x4, END_HEADERS = 0x4,

View File

@ -6,7 +6,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
[Flags] [Flags]
public enum Http2DataFrameFlags : byte internal enum Http2DataFrameFlags : byte
{ {
NONE = 0x0, NONE = 0x0,
END_STREAM = 0x1, END_STREAM = 0x1,

View File

@ -4,7 +4,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public enum Http2ErrorCode : uint internal enum Http2ErrorCode : uint
{ {
NO_ERROR = 0x0, NO_ERROR = 0x0,
PROTOCOL_ERROR = 0x1, PROTOCOL_ERROR = 0x1,

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
| Header Block Fragment (*) ... | Header Block Fragment (*) ...
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public Http2ContinuationFrameFlags ContinuationFlags public Http2ContinuationFrameFlags ContinuationFlags
{ {

View File

@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
| Padding (*) ... | Padding (*) ...
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public Http2DataFrameFlags DataFlags public Http2DataFrameFlags DataFlags
{ {

View File

@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
| Additional Debug Data (*) | | Additional Debug Data (*) |
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public int GoAwayLastStreamId { get; set; } public int GoAwayLastStreamId { get; set; }

View File

@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
| Padding (*) ... | Padding (*) ...
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public Http2HeadersFrameFlags HeadersFlags public Http2HeadersFrameFlags HeadersFlags
{ {

View File

@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
| | | |
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public Http2PingFrameFlags PingFlags public Http2PingFrameFlags PingFlags
{ {

View File

@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
| Weight (8) | | Weight (8) |
+-+-------------+ +-+-------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public int PriorityStreamDependency { get; set; } public int PriorityStreamDependency { get; set; }

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
| Error Code (32) | | Error Code (32) |
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public Http2ErrorCode RstStreamErrorCode { get; set; } public Http2ErrorCode RstStreamErrorCode { get; set; }

View File

@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
| Value (32) | | Value (32) |
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public Http2SettingsFrameFlags SettingsFlags public Http2SettingsFrameFlags SettingsFlags
{ {

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
|R| Window Size Increment (31) | |R| Window Size Increment (31) |
+-+-------------------------------------------------------------+ +-+-------------------------------------------------------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public int WindowUpdateSizeIncrement { get; set; } public int WindowUpdateSizeIncrement { get; set; }

View File

@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
| Frame Payload (0...) ... | Frame Payload (0...) ...
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
public partial class Http2Frame internal partial class Http2Frame
{ {
public int PayloadLength { get; set; } public int PayloadLength { get; set; }

View File

@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public static class Http2FrameReader internal static class Http2FrameReader
{ {
/* https://tools.ietf.org/html/rfc7540#section-4.1 /* https://tools.ietf.org/html/rfc7540#section-4.1
+-----------------------------------------------+ +-----------------------------------------------+

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public enum Http2FrameType : byte internal enum Http2FrameType : byte
{ {
DATA = 0x0, DATA = 0x0,
HEADERS = 0x1, HEADERS = 0x1,

View File

@ -18,7 +18,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public class Http2FrameWriter internal class Http2FrameWriter
{ {
// Literal Header Field without Indexing - Indexed Name (Index 8 - :status) // Literal Header Field without Indexing - Indexed Name (Index 8 - :status)
private static ReadOnlySpan<byte> _continueBytes => new byte[] { 0x08, 0x03, (byte)'1', (byte)'0', (byte)'0' }; private static ReadOnlySpan<byte> _continueBytes => new byte[] { 0x08, 0x03, (byte)'1', (byte)'0', (byte)'0' };

View File

@ -6,7 +6,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
[Flags] [Flags]
public enum Http2HeadersFrameFlags : byte internal enum Http2HeadersFrameFlags : byte
{ {
NONE = 0x0, NONE = 0x0,
END_STREAM = 0x1, END_STREAM = 0x1,

View File

@ -10,7 +10,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public class Http2MessageBody : MessageBody internal class Http2MessageBody : MessageBody
{ {
private readonly Http2Stream _context; private readonly Http2Stream _context;
private ReadResult _readResult; private ReadResult _readResult;

View File

@ -16,7 +16,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public class Http2OutputProducer : IHttpOutputProducer, IHttpOutputAborter internal class Http2OutputProducer : IHttpOutputProducer, IHttpOutputAborter
{ {
private readonly int _streamId; private readonly int _streamId;
private readonly Http2FrameWriter _frameWriter; private readonly Http2FrameWriter _frameWriter;

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public readonly struct Http2PeerSetting internal readonly struct Http2PeerSetting
{ {
public Http2PeerSetting(Http2SettingsParameter parameter, uint value) public Http2PeerSetting(Http2SettingsParameter parameter, uint value)
{ {

View File

@ -5,7 +5,7 @@ using System.Collections.Generic;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public class Http2PeerSettings internal class Http2PeerSettings
{ {
// Note these are protocol defaults, not Kestrel defaults. // Note these are protocol defaults, not Kestrel defaults.
public const uint DefaultHeaderTableSize = 4096; public const uint DefaultHeaderTableSize = 4096;

View File

@ -6,7 +6,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
[Flags] [Flags]
public enum Http2PingFrameFlags : byte internal enum Http2PingFrameFlags : byte
{ {
NONE = 0x0, NONE = 0x0,
ACK = 0x1 ACK = 0x1

View File

@ -6,7 +6,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
[Flags] [Flags]
public enum Http2SettingsFrameFlags : byte internal enum Http2SettingsFrameFlags : byte
{ {
NONE = 0x0, NONE = 0x0,
ACK = 0x1, ACK = 0x1,

View File

@ -3,7 +3,7 @@
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public enum Http2SettingsParameter : ushort internal enum Http2SettingsParameter : ushort
{ {
SETTINGS_HEADER_TABLE_SIZE = 0x1, SETTINGS_HEADER_TABLE_SIZE = 0x1,
SETTINGS_ENABLE_PUSH = 0x2, SETTINGS_ENABLE_PUSH = 0x2,

View File

@ -5,7 +5,7 @@ using System;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public class Http2SettingsParameterOutOfRangeException : Exception internal class Http2SettingsParameterOutOfRangeException : Exception
{ {
public Http2SettingsParameterOutOfRangeException(Http2SettingsParameter parameter, long lowerBound, long upperBound) public Http2SettingsParameterOutOfRangeException(Http2SettingsParameter parameter, long lowerBound, long upperBound)
: base($"HTTP/2 SETTINGS parameter {parameter} must be set to a value between {lowerBound} and {upperBound}") : base($"HTTP/2 SETTINGS parameter {parameter} must be set to a value between {lowerBound} and {upperBound}")

View File

@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public partial class Http2Stream : IHttp2StreamIdFeature, IHttpResponseTrailersFeature internal partial class Http2Stream : IHttp2StreamIdFeature, IHttpResponseTrailersFeature
{ {
internal HttpResponseTrailers Trailers { get; set; } internal HttpResponseTrailers Trailers { get; set; }
private IHeaderDictionary _userTrailers; private IHeaderDictionary _userTrailers;

View File

@ -18,7 +18,7 @@ using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public abstract partial class Http2Stream : HttpProtocol, IThreadPoolWorkItem internal abstract partial class Http2Stream : HttpProtocol, IThreadPoolWorkItem
{ {
private readonly Http2StreamContext _context; private readonly Http2StreamContext _context;
private readonly Http2OutputProducer _http2Output; private readonly Http2OutputProducer _http2Output;

View File

@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2.FlowControl;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2 namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
{ {
public class Http2StreamContext : HttpConnectionContext internal class Http2StreamContext : HttpConnectionContext
{ {
public int StreamId { get; set; } public int StreamId { get; set; }
public IHttp2StreamLifetimeHandler StreamLifetimeHandler { get; set; } public IHttp2StreamLifetimeHandler StreamLifetimeHandler { get; set; }

Some files were not shown because too many files have changed in this diff Show More