227 references to ConnectionEndReason
Microsoft.AspNetCore.Server.Kestrel.Core (227)
Internal\Http\Http1ChunkedEncodingMessageBody.cs (1)
145
KestrelMetrics.AddConnectionEndReason(_context.MetricsContext,
ConnectionEndReason
.UnexpectedEndOfRequestContent);
Internal\Http\Http1Connection.cs (23)
134
_http1Output.Abort(ServerOptions.FinOnError ? new ConnectionAbortedException(CoreStrings.ConnectionAbortedByClient) : null!,
ConnectionEndReason
.TransportCompleted);
140
_http1Output.Abort(new ConnectionAbortedException(CoreStrings.ConnectionAbortedByClient),
ConnectionEndReason
.TransportCompleted);
147
public void Abort(ConnectionAbortedException abortReason,
ConnectionEndReason
reason)
157
Abort(new ConnectionAbortedException(CoreStrings.ConnectionAbortedByApplication),
ConnectionEndReason
.AbortedByApp);
165
public void StopProcessingNextRequest(
ConnectionEndReason
reason)
171
internal override void DisableKeepAlive(
ConnectionEndReason
reason)
185
KestrelMetrics.AddConnectionEndReason(MetricsContext,
ConnectionEndReason
.RequestHeadersTimeout);
193
KestrelMetrics.AddConnectionEndReason(MetricsContext,
ConnectionEndReason
.MinRequestBodyDataRate);
809
KestrelMetrics.AddConnectionEndReason(MetricsContext,
ConnectionEndReason
.InvalidRequestHeaders);
820
KestrelMetrics.AddConnectionEndReason(MetricsContext,
ConnectionEndReason
.InvalidRequestHeaders);
853
KestrelMetrics.AddConnectionEndReason(MetricsContext,
ConnectionEndReason
.InvalidRequestHeaders);
862
KestrelMetrics.AddConnectionEndReason(MetricsContext,
ConnectionEndReason
.InvalidRequestHeaders);
946
KestrelMetrics.AddConnectionEndReason(MetricsContext,
ConnectionEndReason
.OtherError);
999
internal static
ConnectionEndReason
GetConnectionEndReason(Microsoft.AspNetCore.Http.BadHttpRequestException ex)
1008
return
ConnectionEndReason
.InvalidHttpVersion;
1012
return
ConnectionEndReason
.InvalidRequestLine;
1025
return
ConnectionEndReason
.InvalidRequestHeaders;
1027
return
ConnectionEndReason
.MaxRequestHeadersTotalSizeExceeded;
1029
return
ConnectionEndReason
.MaxRequestHeaderCountExceeded;
1031
return
ConnectionEndReason
.TlsNotSupported;
1033
return
ConnectionEndReason
.UnexpectedEndOfRequestContent;
1037
return
ConnectionEndReason
.OtherError;
1096
var
reason = GetConnectionEndReason(ex);
Internal\Http\Http1ContentLengthMessageBody.cs (1)
250
_context.DisableKeepAlive(
ConnectionEndReason
.MaxRequestBodySizeExceeded);
Internal\Http\Http1MessageBody.cs (5)
77
_context.StopProcessingNextRequest(
ConnectionEndReason
.InvalidBodyReaderState);
112
_context.StopProcessingNextRequest(
ConnectionEndReason
.InvalidBodyReaderState);
122
_context.DisableKeepAlive(
ConnectionEndReason
.MaxRequestBodySizeExceeded);
226
KestrelMetrics.AddConnectionEndReason(context.MetricsContext,
ConnectionEndReason
.InvalidRequestHeaders);
247
KestrelMetrics.AddConnectionEndReason(_context.MetricsContext,
ConnectionEndReason
.UnexpectedEndOfRequestContent);
Internal\Http\Http1OutputProducer.cs (1)
462
public void Abort(ConnectionAbortedException error,
ConnectionEndReason
reason)
Internal\Http\HttpProtocol.cs (10)
684
DisableKeepAlive(
ConnectionEndReason
.RequestNoKeepAlive);
893
DisableKeepAlive(
ConnectionEndReason
.ResponseContentLengthMismatch);
946
DisableKeepAlive(
ConnectionEndReason
.ResponseContentLengthMismatch);
1065
DisableKeepAlive(
ConnectionEndReason
.ErrorAfterStartingResponse);
1172
DisableKeepAlive(
ConnectionEndReason
.ResponseNoKeepAlive);
1183
DisableKeepAlive(
ConnectionEndReason
.ResponseNoKeepAlive);
1219
DisableKeepAlive(
ConnectionEndReason
.ResponseNoKeepAlive);
1252
DisableKeepAlive(
ConnectionEndReason
.ResponseNoKeepAlive);
1262
DisableKeepAlive(
ConnectionEndReason
.ResponseNoKeepAlive);
1456
internal virtual void DisableKeepAlive(
ConnectionEndReason
reason)
Internal\Http\IHttpOutputAborter.cs (1)
10
void Abort(ConnectionAbortedException abortReason,
ConnectionEndReason
reason);
Internal\Http2\FlowControl\InputFlowControl.cs (1)
56
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorFlowControlWindowExceeded, Http2ErrorCode.FLOW_CONTROL_ERROR,
ConnectionEndReason
.FlowControlWindowExceeded);
Internal\Http2\Http2Connection.cs (63)
147
private
ConnectionEndReason
_gracefulCloseReason;
233
SetConnectionErrorCode(hasActiveStreams ?
ConnectionEndReason
.ConnectionReset :
ConnectionEndReason
.TransportCompleted, Http2ErrorCode.NO_ERROR);
239
private void SetConnectionErrorCode(
ConnectionEndReason
reason, Http2ErrorCode errorCode)
246
public void Abort(ConnectionAbortedException ex,
ConnectionEndReason
reason)
251
public void Abort(ConnectionAbortedException ex, Http2ErrorCode errorCode,
ConnectionEndReason
reason)
262
public void StopProcessingNextRequest(
ConnectionEndReason
reason)
268
Abort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestHeadersTimeout), Http2ErrorCode.INTERNAL_ERROR,
ConnectionEndReason
.RequestHeadersTimeout);
276
Abort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestBodyTimeout), Http2ErrorCode.INTERNAL_ERROR,
ConnectionEndReason
.MinRequestBodyDataRate);
279
public void StopProcessingNextRequest(bool serverInitiated,
ConnectionEndReason
reason)
294
var
reason =
ConnectionEndReason
.Unset;
305
reason =
ConnectionEndReason
.TransportCompleted;
365
reason =
ConnectionEndReason
.TransportCompleted;
382
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorKeepAliveTimeout, Http2ErrorCode.INTERNAL_ERROR,
ConnectionEndReason
.KeepAliveTimeout);
400
reason =
ConnectionEndReason
.ConnectionReset;
404
reason =
ConnectionEndReason
.TransportCompleted;
413
reason =
ConnectionEndReason
.IOError;
434
reason =
ConnectionEndReason
.ErrorReadingHeaders;
441
reason =
ConnectionEndReason
.OtherError;
517
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorMinTlsVersion(tlsFeature.Protocol), Http2ErrorCode.INADEQUATE_SECURITY,
ConnectionEndReason
.InsufficientTlsVersion);
602
SetConnectionErrorCode(
ConnectionEndReason
.InvalidHttpVersion, Http2ErrorCode.PROTOCOL_ERROR);
617
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorInvalidPreface, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidHandshake);
689
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdEven(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidStreamId);
699
Http2FrameType.PUSH_PROMISE => throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorPushPromiseReceived, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.UnexpectedFrame),
722
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorPaddingTooLong(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidDataPadding);
744
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamHalfClosedRemote(_incomingFrame.Type, stream.StreamId), Http2ErrorCode.STREAM_CLOSED,
ConnectionEndReason
.FrameAfterStreamClose);
761
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.STREAM_CLOSED,
ConnectionEndReason
.FrameAfterStreamClose);
766
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamAborted(_incomingFrame.Type, stream.StreamId), Http2ErrorCode.STREAM_CLOSED,
ConnectionEndReason
.FrameAfterStreamClose);
771
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdZero(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidStreamId);
776
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdNotZero(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidStreamId);
782
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorHeadersInterleaved(_incomingFrame.Type, _incomingFrame.StreamId, _currentHeadersStream.StreamId), Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.UnexpectedFrame);
787
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorUnexpectedFrameLength(_incomingFrame.Type, expectedLength), Http2ErrorCode.FRAME_SIZE_ERROR,
ConnectionEndReason
.InvalidFrameLength);
804
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorPaddingTooLong(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidDataPadding);
809
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamSelfDependency(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.StreamSelfDependency);
829
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamHalfClosedRemote(_incomingFrame.Type, stream.StreamId), Http2ErrorCode.STREAM_CLOSED,
ConnectionEndReason
.FrameAfterStreamClose);
835
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorHeadersWithTrailersNoEndStream, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.MissingStreamEnd);
866
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.STREAM_CLOSED,
ConnectionEndReason
.InvalidStreamId);
944
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamSelfDependency(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.StreamSelfDependency);
1011
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorSettingsAckLengthNotZero, Http2ErrorCode.FRAME_SIZE_ERROR,
ConnectionEndReason
.InvalidFrameLength);
1019
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorSettingsLengthNotMultipleOfSix, Http2ErrorCode.FRAME_SIZE_ERROR,
ConnectionEndReason
.InvalidFrameLength);
1053
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorInitialWindowSizeInvalid, Http2ErrorCode.FLOW_CONTROL_ERROR,
ConnectionEndReason
.InvalidSettings);
1075
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorSettingsParameterOutOfRange(ex.Parameter), errorCode,
ConnectionEndReason
.InvalidSettings);
1126
StopProcessingNextRequest(serverInitiated: false,
ConnectionEndReason
.ClientGoAway);
1163
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorWindowUpdateIncrementZero, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidWindowUpdateSize);
1170
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorWindowUpdateSizeInvalid, Http2ErrorCode.FLOW_CONTROL_ERROR,
ConnectionEndReason
.InvalidWindowUpdateSize);
1204
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorContinuationWithNoHeaders, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.UnexpectedFrame);
1356
Abort(new ConnectionAbortedException(CoreStrings.Http2ConnectionFaulted), Http2ErrorCode.ENHANCE_YOUR_CALM,
ConnectionEndReason
.StreamResetLimitExceeded);
1358
throw new Http2ConnectionErrorException(CoreStrings.Http2ConnectionFaulted, Http2ErrorCode.ENHANCE_YOUR_CALM,
ConnectionEndReason
.StreamResetLimitExceeded);
1417
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdle(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidStreamId);
1473
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.STREAM_CLOSED,
ConnectionEndReason
.FrameAfterStreamClose);
1617
throw new Http2ConnectionErrorException(CoreStrings.BadRequest_HeadersExceedMaxTotalSize, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.MaxRequestHeadersTotalSizeExceeded);
1624
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorConnectionSpecificHeaderField, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
1684
throw new Http2ConnectionErrorException(bre.Message, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.MaxRequestHeaderCountExceeded);
1689
throw new Http2ConnectionErrorException(bre.Message, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
1693
throw new Http2ConnectionErrorException(CoreStrings.BadRequest_MalformedRequestInvalidHeaders, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
1710
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorTrailerNameUppercase, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
1714
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorHeaderNameUppercase, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
1743
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorPseudoHeaderFieldAfterRegularHeaders, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
1749
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorTrailersContainPseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
1758
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorUnknownPseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
1765
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorResponsePseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
1772
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorDuplicatePseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR,
ConnectionEndReason
.InvalidRequestHeaders);
Internal\Http2\Http2FrameWriter.cs (6)
172
_http2Connection.Abort(ex, Http2ErrorCode.INTERNAL_ERROR,
ConnectionEndReason
.OutputQueueSizeExceeded);
352
const
ConnectionEndReason
reason =
ConnectionEndReason
.InvalidWindowUpdateSize;
559
_http2Connection.Abort(new ConnectionAbortedException(ex.Message, ex), Http2ErrorCode.INTERNAL_ERROR,
ConnectionEndReason
.ErrorWritingHeaders);
600
_http2Connection.Abort(new ConnectionAbortedException(ex.Message, ex), Http2ErrorCode.INTERNAL_ERROR,
ConnectionEndReason
.ErrorWritingHeaders);
1131
_http2Connection.Abort(new ConnectionAbortedException("HTTP/2 connection exceeded the outgoing flow control maximum queue size."), Http2ErrorCode.INTERNAL_ERROR,
ConnectionEndReason
.FlowControlQueueSizeExceeded);
Internal\Http2\Http2OutputProducer.cs (1)
248
void IHttpOutputAborter.Abort(ConnectionAbortedException abortReason,
ConnectionEndReason
reason)
Internal\Http3\Http3Connection.cs (22)
48
private
ConnectionEndReason
_gracefulCloseReason;
107
public void StopProcessingNextRequest(
ConnectionEndReason
reason)
110
public void StopProcessingNextRequest(bool serverInitiated,
ConnectionEndReason
reason)
157
public void Abort(ConnectionAbortedException ex,
ConnectionEndReason
reason)
162
public void Abort(ConnectionAbortedException ex, Http3ErrorCode errorCode,
ConnectionEndReason
reason)
244
connection.OnStreamConnectionError(new Http3ConnectionErrorException(CoreStrings.Http3ErrorControlStreamClosed, Http3ErrorCode.ClosedCriticalStream,
ConnectionEndReason
.ClosedCriticalStream));
322
OnStreamConnectionError(new Http3ConnectionErrorException(CoreStrings.ConnectionTimedBecauseResponseMininumDataRateNotSatisfied, Http3ErrorCode.InternalError,
ConnectionEndReason
.MinResponseDataRate));
344
ConnectionEndReason
reason =
ConnectionEndReason
.Unset;
471
reason =
ConnectionEndReason
.ConnectionReset;
475
reason =
ConnectionEndReason
.TransportCompleted;
485
reason =
ConnectionEndReason
.IOError;
491
reason =
ConnectionEndReason
.OtherError;
502
reason =
ConnectionEndReason
.OtherError;
545
if (reason ==
ConnectionEndReason
.Unset && _gracefulCloseReason !=
ConnectionEndReason
.Unset)
580
Abort(CreateConnectionAbortError(error, clientAbort), Http3ErrorCode.InternalError,
ConnectionEndReason
.OtherError);
742
var connectionError = new Http3ConnectionErrorException(CoreStrings.Http3ControlStreamErrorInitializingOutbound, Http3ErrorCode.ClosedCriticalStream,
ConnectionEndReason
.ClosedCriticalStream);
746
Abort(new ConnectionAbortedException(connectionError.Message, connectionError), connectionError.ErrorCode,
ConnectionEndReason
.ClosedCriticalStream);
908
Abort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestHeadersTimeout),
ConnectionEndReason
.RequestHeadersTimeout);
916
Abort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestBodyTimeout),
ConnectionEndReason
.MinRequestBodyDataRate);
924
Abort(new ConnectionAbortedException(CoreStrings.ConnectionAbortedByClient), Http3ErrorCodeOrNoError,
ConnectionEndReason
.TransportCompleted);
Internal\Http3\Http3ConnectionErrorException.cs (2)
10
public Http3ConnectionErrorException(string message, Http3ErrorCode errorCode,
ConnectionEndReason
reason)
18
public
ConnectionEndReason
Reason { get; }
Internal\Http3\Http3ControlStream.cs (10)
212
throw new Http3ConnectionErrorException(CoreStrings.FormatHttp3ControlStreamErrorMultipleInboundStreams("control"), Http3ErrorCode.StreamCreationError,
ConnectionEndReason
.StreamCreationError);
221
throw new Http3ConnectionErrorException(CoreStrings.FormatHttp3ControlStreamErrorMultipleInboundStreams("encoder"), Http3ErrorCode.StreamCreationError,
ConnectionEndReason
.StreamCreationError);
230
throw new Http3ConnectionErrorException(CoreStrings.FormatHttp3ControlStreamErrorMultipleInboundStreams("decoder"), Http3ErrorCode.StreamCreationError,
ConnectionEndReason
.StreamCreationError);
335
throw new Http3ConnectionErrorException(CoreStrings.FormatHttp3ErrorUnsupportedFrameOnControlStream(incomingFrame.FormattedType), Http3ErrorCode.UnexpectedFrame,
ConnectionEndReason
.UnexpectedFrame);
355
throw new Http3ConnectionErrorException(CoreStrings.FormatHttp3ControlStreamFrameTooLarge(http3RawFrame.FormattedType), Http3ErrorCode.FrameError,
ConnectionEndReason
.InvalidFrameLength);
367
throw new Http3ConnectionErrorException(CoreStrings.Http3ErrorControlStreamMultipleSettingsFrames, Http3ErrorCode.UnexpectedFrame,
ConnectionEndReason
.UnexpectedFrame);
407
throw new Http3ConnectionErrorException(message, Http3ErrorCode.SettingsError,
ConnectionEndReason
.InvalidSettings);
433
_context.Connection.StopProcessingNextRequest(serverInitiated: false,
ConnectionEndReason
.ClientGoAway);
490
throw new Http3ConnectionErrorException(CoreStrings.FormatHttp3ControlStreamFrameTooLarge(Http3Formatting.ToFormattedType(incomingFrame.Type)), Http3ErrorCode.FrameError,
ConnectionEndReason
.InvalidFrameLength);
499
throw new Http3ConnectionErrorException(message, Http3ErrorCode.MissingSettings,
ConnectionEndReason
.InvalidSettings);
Internal\Http3\Http3OutputProducer.cs (1)
108
void IHttpOutputAborter.Abort(ConnectionAbortedException abortReason,
ConnectionEndReason
reason)
Internal\Http3\Http3Stream.cs (5)
849
CoreStrings.FormatHttp3ErrorUnsupportedFrameOnRequestStream(incomingFrame.FormattedType), Http3ErrorCode.UnexpectedFrame,
ConnectionEndReason
.UnexpectedFrame),
852
CoreStrings.FormatHttp3ErrorUnsupportedFrameOnServer(incomingFrame.FormattedType), Http3ErrorCode.UnexpectedFrame,
ConnectionEndReason
.UnexpectedFrame),
872
throw new Http3ConnectionErrorException(CoreStrings.FormatHttp3StreamErrorFrameReceivedAfterTrailers(Http3Formatting.ToFormattedType(Http3FrameType.Headers)), Http3ErrorCode.UnexpectedFrame,
ConnectionEndReason
.UnexpectedFrame);
982
throw new Http3ConnectionErrorException(CoreStrings.Http3StreamErrorDataReceivedBeforeHeaders, Http3ErrorCode.UnexpectedFrame,
ConnectionEndReason
.UnexpectedFrame);
990
throw new Http3ConnectionErrorException(message, Http3ErrorCode.UnexpectedFrame,
ConnectionEndReason
.UnexpectedFrame);
Internal\HttpConnection.cs (6)
114
using var shutdownRegistration = connectionLifetimeNotificationFeature?.ConnectionClosedRequested.Register(state => ((HttpConnection)state!).StopProcessingNextRequest(
ConnectionEndReason
.GracefulAppShutdown), this);
153
private void StopProcessingNextRequest(
ConnectionEndReason
reason)
191
private void Abort(ConnectionAbortedException ex,
ConnectionEndReason
reason)
281
_requestProcessor!.StopProcessingNextRequest(
ConnectionEndReason
.KeepAliveTimeout);
291
Abort(new ConnectionAbortedException(CoreStrings.ConnectionTimedBecauseResponseMininumDataRateNotSatisfied),
ConnectionEndReason
.MinResponseDataRate);
295
Abort(new ConnectionAbortedException(CoreStrings.ConnectionTimedOutByServer),
ConnectionEndReason
.ServerTimeout);
Internal\Infrastructure\ConnectionMetricsContext.cs (1)
18
public
ConnectionEndReason
? ConnectionEndReason { get; set; }
Internal\Infrastructure\KestrelMetrics.cs (58)
160
AddConnectionEndReason(metricsContext,
ConnectionEndReason
.MaxConcurrentConnectionsExceeded);
410
public static void AddConnectionEndReason(IConnectionMetricsTagsFeature? feature,
ConnectionEndReason
reason)
412
Debug.Assert(reason !=
ConnectionEndReason
.Unset);
423
public static void AddConnectionEndReason(ConnectionMetricsContext? context,
ConnectionEndReason
reason, bool overwrite = false)
425
Debug.Assert(reason !=
ConnectionEndReason
.Unset);
449
internal static string? GetErrorType(
ConnectionEndReason
reason)
455
internal static bool TryGetErrorType(
ConnectionEndReason
reason, [NotNullWhen(true)]out string? errorTypeValue)
459
ConnectionEndReason
.Unset => null, // Not an error
460
ConnectionEndReason
.ClientGoAway => null, // Not an error
461
ConnectionEndReason
.TransportCompleted => null, // Not an error
462
ConnectionEndReason
.GracefulAppShutdown => null, // Not an error
463
ConnectionEndReason
.RequestNoKeepAlive => null, // Not an error
464
ConnectionEndReason
.ResponseNoKeepAlive => null, // Not an error
465
ConnectionEndReason
.ErrorAfterStartingResponse => "error_after_starting_response",
466
ConnectionEndReason
.ConnectionReset => "connection_reset",
467
ConnectionEndReason
.FlowControlWindowExceeded => "flow_control_window_exceeded",
468
ConnectionEndReason
.KeepAliveTimeout => "keep_alive_timeout",
469
ConnectionEndReason
.InsufficientTlsVersion => "insufficient_tls_version",
470
ConnectionEndReason
.InvalidHandshake => "invalid_handshake",
471
ConnectionEndReason
.InvalidStreamId => "invalid_stream_id",
472
ConnectionEndReason
.FrameAfterStreamClose => "frame_after_stream_close",
473
ConnectionEndReason
.UnknownStream => "unknown_stream",
474
ConnectionEndReason
.UnexpectedFrame => "unexpected_frame",
475
ConnectionEndReason
.InvalidFrameLength => "invalid_frame_length",
476
ConnectionEndReason
.InvalidDataPadding => "invalid_data_padding",
477
ConnectionEndReason
.InvalidRequestHeaders => "invalid_request_headers",
478
ConnectionEndReason
.StreamResetLimitExceeded => "stream_reset_limit_exceeded",
479
ConnectionEndReason
.InvalidWindowUpdateSize => "invalid_window_update_size",
480
ConnectionEndReason
.StreamSelfDependency => "stream_self_dependency",
481
ConnectionEndReason
.InvalidSettings => "invalid_settings",
482
ConnectionEndReason
.MissingStreamEnd => "missing_stream_end",
483
ConnectionEndReason
.MaxFrameLengthExceeded => "max_frame_length_exceeded",
484
ConnectionEndReason
.ErrorReadingHeaders => "error_reading_headers",
485
ConnectionEndReason
.ErrorWritingHeaders => "error_writing_headers",
486
ConnectionEndReason
.OtherError => "other_error",
487
ConnectionEndReason
.InvalidHttpVersion => "invalid_http_version",
488
ConnectionEndReason
.RequestHeadersTimeout => "request_headers_timeout",
489
ConnectionEndReason
.MinRequestBodyDataRate => "min_request_body_data_rate",
490
ConnectionEndReason
.MinResponseDataRate => "min_response_data_rate",
491
ConnectionEndReason
.FlowControlQueueSizeExceeded => "flow_control_queue_size_exceeded",
492
ConnectionEndReason
.OutputQueueSizeExceeded => "output_queue_size_exceeded",
493
ConnectionEndReason
.ClosedCriticalStream => "closed_critical_stream",
494
ConnectionEndReason
.AbortedByApp => "aborted_by_app",
495
ConnectionEndReason
.WriteCanceled => "write_canceled",
496
ConnectionEndReason
.InvalidBodyReaderState => "invalid_body_reader_state",
497
ConnectionEndReason
.ServerTimeout => "server_timeout",
498
ConnectionEndReason
.StreamCreationError => "stream_creation_error",
499
ConnectionEndReason
.IOError => "io_error",
500
ConnectionEndReason
.AppShutdownTimeout => "app_shutdown_timeout",
501
ConnectionEndReason
.TlsHandshakeFailed => "tls_handshake_failed",
502
ConnectionEndReason
.InvalidRequestLine => "invalid_request_line",
503
ConnectionEndReason
.TlsNotSupported => "tls_not_supported",
504
ConnectionEndReason
.MaxRequestBodySizeExceeded => "max_request_body_size_exceeded",
505
ConnectionEndReason
.UnexpectedEndOfRequestContent => "unexpected_end_of_request_content",
506
ConnectionEndReason
.MaxConcurrentConnectionsExceeded => "max_concurrent_connections_exceeded",
507
ConnectionEndReason
.MaxRequestHeadersTotalSizeExceeded => "max_request_headers_total_size_exceeded",
508
ConnectionEndReason
.MaxRequestHeaderCountExceeded => "max_request_header_count_exceeded",
509
ConnectionEndReason
.ResponseContentLengthMismatch => "response_content_length_mismatch",
Internal\Infrastructure\PipeWriterHelpers\TimingPipeFlusher.cs (1)
95
outputAborter.Abort(new ConnectionAbortedException(CoreStrings.ConnectionOrStreamAbortedByCancellationToken, ex),
ConnectionEndReason
.WriteCanceled);
Internal\Infrastructure\TransportConnectionManager.cs (1)
83
ConnectionEndReason
.AppShutdownTimeout, overwrite: true);
Internal\IRequestProcessor.cs (2)
12
void StopProcessingNextRequest(
ConnectionEndReason
reason);
17
void Abort(ConnectionAbortedException ex,
ConnectionEndReason
reason);
Middleware\HttpsConnectionMiddleware.cs (1)
275
KestrelMetrics.AddConnectionEndReason(metricsTagsFeature,
ConnectionEndReason
.TlsHandshakeFailed);
src\aspnetcore\src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (2)
10
public Http2ConnectionErrorException(string message, Http2ErrorCode errorCode,
ConnectionEndReason
reason)
18
public
ConnectionEndReason
Reason { get; }
src\aspnetcore\src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (2)
54
throw new Http2ConnectionErrorException(SharedStrings.FormatHttp2ErrorFrameOverLimit(payloadLength, maxFrameSize), Http2ErrorCode.FRAME_SIZE_ERROR,
ConnectionEndReason
.MaxFrameLengthExceeded);
86
SharedStrings.FormatHttp2ErrorUnexpectedFrameLength(frame.Type, expectedLength: extendedHeaderLength), Http2ErrorCode.FRAME_SIZE_ERROR,
ConnectionEndReason
.InvalidFrameLength);