108 references to Http2ErrorCode
Microsoft.AspNetCore.Server.Kestrel.Core (108)
Internal\Http2\FlowControl\InputFlowControl.cs (1)
56
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorFlowControlWindowExceeded,
Http2ErrorCode
.FLOW_CONTROL_ERROR, ConnectionEndReason.FlowControlWindowExceeded);
Internal\Http2\Http2Connection.cs (62)
229
SetConnectionErrorCode(hasActiveStreams ? ConnectionEndReason.ConnectionReset : ConnectionEndReason.TransportCompleted,
Http2ErrorCode
.NO_ERROR);
235
private void SetConnectionErrorCode(ConnectionEndReason reason,
Http2ErrorCode
errorCode)
244
Abort(ex,
Http2ErrorCode
.INTERNAL_ERROR, reason);
247
public void Abort(ConnectionAbortedException ex,
Http2ErrorCode
errorCode, ConnectionEndReason reason)
264
Abort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestHeadersTimeout),
Http2ErrorCode
.INTERNAL_ERROR, ConnectionEndReason.RequestHeadersTimeout);
272
Abort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestBodyTimeout),
Http2ErrorCode
.INTERNAL_ERROR, ConnectionEndReason.MinRequestBodyDataRate);
289
var
errorCode =
Http2ErrorCode
.NO_ERROR;
378
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorKeepAliveTimeout,
Http2ErrorCode
.INTERNAL_ERROR, ConnectionEndReason.KeepAliveTimeout);
429
errorCode =
Http2ErrorCode
.COMPRESSION_ERROR;
436
errorCode =
Http2ErrorCode
.INTERNAL_ERROR;
513
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorMinTlsVersion(tlsFeature.Protocol),
Http2ErrorCode
.INADEQUATE_SECURITY, ConnectionEndReason.InsufficientTlsVersion);
598
SetConnectionErrorCode(ConnectionEndReason.InvalidHttpVersion,
Http2ErrorCode
.PROTOCOL_ERROR);
613
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorInvalidPreface,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidHandshake);
685
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdEven(_incomingFrame.Type, _incomingFrame.StreamId),
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidStreamId);
695
Http2FrameType.PUSH_PROMISE => throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorPushPromiseReceived,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.UnexpectedFrame),
718
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorPaddingTooLong(_incomingFrame.Type),
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidDataPadding);
740
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamHalfClosedRemote(_incomingFrame.Type, stream.StreamId),
Http2ErrorCode
.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose);
757
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId),
Http2ErrorCode
.STREAM_CLOSED, ConnectionEndReason.UnknownStream);
762
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamAborted(_incomingFrame.Type, stream.StreamId),
Http2ErrorCode
.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose);
767
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdZero(_incomingFrame.Type),
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidStreamId);
772
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdNotZero(_incomingFrame.Type),
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidStreamId);
778
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorHeadersInterleaved(_incomingFrame.Type, _incomingFrame.StreamId, _currentHeadersStream.StreamId),
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.UnexpectedFrame);
783
return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorUnexpectedFrameLength(_incomingFrame.Type, expectedLength),
Http2ErrorCode
.FRAME_SIZE_ERROR, ConnectionEndReason.InvalidFrameLength);
800
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorPaddingTooLong(_incomingFrame.Type),
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidDataPadding);
805
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamSelfDependency(_incomingFrame.Type, _incomingFrame.StreamId),
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.StreamSelfDependency);
825
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamHalfClosedRemote(_incomingFrame.Type, stream.StreamId),
Http2ErrorCode
.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose);
831
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorHeadersWithTrailersNoEndStream,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.MissingStreamEnd);
850
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId),
Http2ErrorCode
.STREAM_CLOSED, ConnectionEndReason.InvalidStreamId);
928
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamSelfDependency(_incomingFrame.Type, _incomingFrame.StreamId),
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.StreamSelfDependency);
995
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorSettingsAckLengthNotZero,
Http2ErrorCode
.FRAME_SIZE_ERROR, ConnectionEndReason.InvalidFrameLength);
1003
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorSettingsLengthNotMultipleOfSix,
Http2ErrorCode
.FRAME_SIZE_ERROR, ConnectionEndReason.InvalidFrameLength);
1037
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorInitialWindowSizeInvalid,
Http2ErrorCode
.FLOW_CONTROL_ERROR, ConnectionEndReason.InvalidSettings);
1055
var
errorCode = ex.Parameter == Http2SettingsParameter.SETTINGS_INITIAL_WINDOW_SIZE
1056
?
Http2ErrorCode
.FLOW_CONTROL_ERROR
1057
:
Http2ErrorCode
.PROTOCOL_ERROR;
1147
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorWindowUpdateIncrementZero,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidWindowUpdateSize);
1154
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorWindowUpdateSizeInvalid,
Http2ErrorCode
.FLOW_CONTROL_ERROR, ConnectionEndReason.InvalidWindowUpdateSize);
1167
throw new Http2StreamErrorException(_incomingFrame.StreamId, CoreStrings.Http2ErrorWindowUpdateSizeInvalid,
Http2ErrorCode
.FLOW_CONTROL_ERROR);
1184
throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorContinuationWithNoHeaders,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.UnexpectedFrame);
1289
throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.HttpErrorMissingMandatoryPseudoHeaderFields,
Http2ErrorCode
.PROTOCOL_ERROR);
1302
throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2ErrorMaxStreams,
Http2ErrorCode
.REFUSED_STREAM);
1322
Abort(new ConnectionAbortedException(CoreStrings.Http2ConnectionFaulted),
Http2ErrorCode
.ENHANCE_YOUR_CALM, ConnectionEndReason.StreamResetLimitExceeded);
1324
throw new Http2ConnectionErrorException(CoreStrings.Http2ConnectionFaulted,
Http2ErrorCode
.ENHANCE_YOUR_CALM, ConnectionEndReason.StreamResetLimitExceeded);
1327
throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2TellClientToCalmDown,
Http2ErrorCode
.ENHANCE_YOUR_CALM);
1383
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdle(_incomingFrame.Type, _incomingFrame.StreamId),
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidStreamId);
1439
throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId),
Http2ErrorCode
.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose);
1507
_frameWriter.WriteGoAwayAsync(int.MaxValue,
Http2ErrorCode
.NO_ERROR).Preserve();
1517
SetConnectionErrorCode(_gracefulCloseReason,
Http2ErrorCode
.NO_ERROR);
1518
_frameWriter.WriteGoAwayAsync(_highestOpenedStreamId,
Http2ErrorCode
.NO_ERROR).Preserve();
1583
throw new Http2ConnectionErrorException(CoreStrings.BadRequest_HeadersExceedMaxTotalSize,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.MaxRequestHeadersTotalSizeExceeded);
1645
throw new Http2ConnectionErrorException(bre.Message,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.MaxRequestHeaderCountExceeded);
1650
throw new Http2ConnectionErrorException(bre.Message,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
1654
throw new Http2ConnectionErrorException(CoreStrings.BadRequest_MalformedRequestInvalidHeaders,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
1665
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorConnectionSpecificHeaderField,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
1676
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorTrailerNameUppercase,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
1680
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorHeaderNameUppercase,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
1709
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorPseudoHeaderFieldAfterRegularHeaders,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
1715
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorTrailersContainPseudoHeaderField,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
1724
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorUnknownPseudoHeaderField,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
1731
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorResponsePseudoHeaderField,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
1738
throw new Http2ConnectionErrorException(CoreStrings.HttpErrorDuplicatePseudoHeaderField,
Http2ErrorCode
.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
Internal\Http2\Http2FrameWriter.cs (8)
172
_http2Connection.Abort(ex,
Http2ErrorCode
.INTERNAL_ERROR, ConnectionEndReason.OutputQueueSizeExceeded);
353
const
Http2ErrorCode
http2ErrorCode =
Http2ErrorCode
.FLOW_CONTROL_ERROR;
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);
875
public ValueTask<FlushResult> WriteRstStreamAsync(int streamId,
Http2ErrorCode
errorCode)
987
public ValueTask<FlushResult> WriteGoAwayAsync(int lastStreamId,
Http2ErrorCode
errorCode)
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 (4)
58
private
Http2ErrorCode
? _resetErrorCode;
253
_stream.ResetAndAbort(abortReason,
Http2ErrorCode
.INTERNAL_ERROR);
258
_stream.ResetAndAbort(new ConnectionAbortedException($"{nameof(Http2OutputProducer)} has completed."),
Http2ErrorCode
.INTERNAL_ERROR);
442
public ValueTask<FlushResult> WriteRstStreamAsync(
Http2ErrorCode
error)
Internal\Http2\Http2Stream.cs (17)
171
_ = _http2Output.WriteRstStreamAsync(
Http2ErrorCode
.NO_ERROR).Preserve();
269
ResetAndAbort(new ConnectionAbortedException(CoreStrings.ConnectRequestsWithProtocolRequireSchemeAndPath),
Http2ErrorCode
.PROTOCOL_ERROR);
278
ResetAndAbort(new ConnectionAbortedException(CoreStrings.Http2ErrorConnectMustNotSendSchemeOrPath),
Http2ErrorCode
.PROTOCOL_ERROR);
289
ResetAndAbort(new ConnectionAbortedException(CoreStrings.ProtocolRequiresConnect),
Http2ErrorCode
.PROTOCOL_ERROR);
305
CoreStrings.FormatHttp2StreamErrorSchemeMismatch(headerScheme, Scheme)),
Http2ErrorCode
.PROTOCOL_ERROR);
336
ResetAndAbort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestLineTooLong),
Http2ErrorCode
.PROTOCOL_ERROR);
356
ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2ErrorMethodInvalid(_methodText)),
Http2ErrorCode
.PROTOCOL_ERROR);
364
ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2ErrorMethodInvalid(_methodText)),
Http2ErrorCode
.PROTOCOL_ERROR);
404
ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatBadRequest_InvalidHostHeader_Detail(hostText)),
Http2ErrorCode
.PROTOCOL_ERROR);
417
ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2StreamErrorPathInvalid(RawTarget)),
Http2ErrorCode
.PROTOCOL_ERROR);
456
ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2StreamErrorPathInvalid(RawTarget)),
Http2ErrorCode
.PROTOCOL_ERROR);
495
throw new Http2StreamErrorException(StreamId, CoreStrings.Http2StreamErrorMoreDataThanLength,
Http2ErrorCode
.PROTOCOL_ERROR);
540
throw new Http2StreamErrorException(StreamId, CoreStrings.Http2StreamErrorLessDataThanLength,
Http2ErrorCode
.PROTOCOL_ERROR);
585
ResetAndAbort(abortReason,
Http2ErrorCode
.INTERNAL_ERROR);
588
protected override void ApplicationAbort() => ApplicationAbort(new ConnectionAbortedException(CoreStrings.ConnectionAbortedByApplication),
Http2ErrorCode
.INTERNAL_ERROR);
590
private void ApplicationAbort(ConnectionAbortedException abortReason,
Http2ErrorCode
error)
595
internal void ResetAndAbort(ConnectionAbortedException abortReason,
Http2ErrorCode
error)
Internal\Http2\Http2Stream.FeatureCollection.cs (2)
64
var abortReason = new ConnectionAbortedException(CoreStrings.FormatHttp2StreamResetByApplication((
Http2ErrorCode
)errorCode));
65
ApplicationAbort(abortReason, (
Http2ErrorCode
)errorCode);
Internal\Http2\Http2StreamErrorException.cs (2)
8
public Http2StreamErrorException(int streamId, string message,
Http2ErrorCode
errorCode)
17
public
Http2ErrorCode
ErrorCode { get; }
Internal\Infrastructure\KestrelTrace.Http2.cs (2)
27
public void Http2StreamResetAbort(string traceIdentifier,
Http2ErrorCode
error, ConnectionAbortedException abortReason)
115
public static partial void Http2StreamResetAbort(ILogger logger, string traceIdentifier,
Http2ErrorCode
error, ConnectionAbortedException abortReason);
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (2)
10
public Http2ConnectionErrorException(string message,
Http2ErrorCode
errorCode, ConnectionEndReason reason)
17
public
Http2ErrorCode
ErrorCode { get; }
src\Shared\ServerInfrastructure\Http2\Http2Frame.GoAway.cs (2)
19
public
Http2ErrorCode
GoAwayErrorCode { get; set; }
21
public void PrepareGoAway(int lastStreamId,
Http2ErrorCode
errorCode)
src\Shared\ServerInfrastructure\Http2\Http2Frame.RstStream.cs (2)
13
public
Http2ErrorCode
RstStreamErrorCode { get; set; }
15
public void PrepareRstStream(int streamId,
Http2ErrorCode
errorCode)
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (4)
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);
154
frame.GoAwayErrorCode = (
Http2ErrorCode
)BinaryPrimitives.ReadUInt32BigEndian(extendedHeaders.Slice(4));
175
frame.RstStreamErrorCode = (
Http2ErrorCode
)BinaryPrimitives.ReadUInt32BigEndian(extendedHeaders);