294 references to Http2ErrorCode
InMemory.FunctionalTests (185)
Http2\Http2ConnectionTests.cs (113)
47await WaitForStreamErrorAsync(5, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 617await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, null); 633await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 658await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 730expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 1365await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.NO_ERROR, null); 1494expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1509expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1525expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1541expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1557expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 1573expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1588expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1606expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 1629expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 1755expectedErrorCode: Http2ErrorCode.ENHANCE_YOUR_CALM, 1774expectedErrorCode: Http2ErrorCode.ENHANCE_YOUR_CALM, 1785expectedErrorCode: Http2ErrorCode.ENHANCE_YOUR_CALM, 1812expectedErrorCode: Http2ErrorCode.ENHANCE_YOUR_CALM, 1845expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 1869expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 1900expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 2512await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 2534expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2550expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2575expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 2597expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 2621expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 2640expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2656expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 2674expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2691expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2707expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2723expectedErrorCode: Http2ErrorCode.COMPRESSION_ERROR, 2753expectedErrorCode: Http2ErrorCode.COMPRESSION_ERROR, 2771expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2791expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2807expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2892expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2907expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2915expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 3080await WaitForStreamErrorAsync(1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.BadRequest_RequestLineTooLong); 3124expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3140expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3158expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 3175expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3191expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3449expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3465expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3481expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3502expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 3519expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3547Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.DATA, 1)); 3573Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.HEADERS, 1)); 3622Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.WINDOW_UPDATE, 1)); 3771expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3778[InlineData((int)(Http2SettingsParameter.SETTINGS_ENABLE_PUSH), 2, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3779[InlineData((int)(Http2SettingsParameter.SETTINGS_ENABLE_PUSH), uint.MaxValue, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3780[InlineData((int)(Http2SettingsParameter.SETTINGS_INITIAL_WINDOW_SIZE), (uint)int.MaxValue + 1, (int)(Http2ErrorCode.FLOW_CONTROL_ERROR))] 3781[InlineData((int)(Http2SettingsParameter.SETTINGS_INITIAL_WINDOW_SIZE), uint.MaxValue, (int)(Http2ErrorCode.FLOW_CONTROL_ERROR))] 3782[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), 0, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3783[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), 1, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3784[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), 16 * 1024 - 1, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3785[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), 16 * 1024 * 1024, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3786[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), uint.MaxValue, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3790var expectedErrorCode = (Http2ErrorCode)intExpectedErrorCode; 3816expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3834expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 3855expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 3881expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 4064expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4105expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4121expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4141expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 4415expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4432expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4448expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4465expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4485expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 4501expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4518expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4534expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4553expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 4572expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 4902expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4919expectedErrorCode: Http2ErrorCode.COMPRESSION_ERROR, 4938expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4955expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4963expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 5060expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 5082expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 5144VerifyGoAway(await ReceiveFrameAsync(), int.MaxValue, Http2ErrorCode.INTERNAL_ERROR); 5158VerifyGoAway(await ReceiveFrameAsync(), 0, Http2ErrorCode.NO_ERROR); 5187VerifyGoAway(await ReceiveFrameAsync(), 3, Http2ErrorCode.NO_ERROR); 5219VerifyGoAway(await ReceiveFrameAsync(), Int32.MaxValue, Http2ErrorCode.NO_ERROR); 5237VerifyGoAway(await ReceiveFrameAsync(), 1, Http2ErrorCode.NO_ERROR); 5250VerifyGoAway(await ReceiveFrameAsync(), Int32.MaxValue, Http2ErrorCode.NO_ERROR); 5376await WaitForStreamErrorAsync(1, Http2ErrorCode.NO_ERROR, null); 5424await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, "The connection was aborted by the application."); 5470await WaitForStreamErrorAsync(1, Http2ErrorCode.CANCEL, "The HTTP/2 stream was reset by the application with error code CANCEL."); 5556await WaitForStreamErrorAsync(1, Http2ErrorCode.REFUSED_STREAM, "HTTP/2 stream ID 1 error (REFUSED_STREAM): A new stream was refused because this connection has reached its stream limit."); 5646await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, "HTTP/2 stream ID 3 error (REFUSED_STREAM): A new stream was refused because this connection has reached its stream limit."); 5647await WaitForStreamErrorAsync(5, Http2ErrorCode.REFUSED_STREAM, "HTTP/2 stream ID 5 error (REFUSED_STREAM): A new stream was refused because this connection has reached its stream limit."); 5648await WaitForStreamErrorAsync(7, Http2ErrorCode.REFUSED_STREAM, "HTTP/2 stream ID 7 error (REFUSED_STREAM): A new stream was refused because this connection has reached its stream limit."); 5691await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 5718await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, "The connection was aborted by the application."); 5731expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 5748expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 5766expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 5795await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, "The connection was aborted by the application."); 5818expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 5879expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR,
Http2\Http2KeepAliveTests.cs (1)
204VerifyGoAway(await ReceiveFrameAsync().DefaultTimeout(), 0, Http2ErrorCode.INTERNAL_ERROR);
Http2\Http2StreamTests.cs (45)
40await WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames: false, 1, Http2ErrorCode.PROTOCOL_ERROR, "Malformed request: invalid headers."); 58await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.FormatHttp2ErrorMethodInvalid("")); 77await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.FormatHttp2ErrorMethodInvalid("Hello,World")); 447await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.Http2ErrorConnectMustNotSendSchemeOrPath); 464await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, 524await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, 724await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, 745await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, 766await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, 789await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.BadRequest_RequestLineTooLong); 1104await WaitForStreamErrorAsync(1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.Http2StreamErrorLessDataThanLength); 1129await WaitForStreamErrorAsync(1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.Http2StreamErrorLessDataThanLength); 1158await WaitForStreamErrorAsync(1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.Http2StreamErrorMoreDataThanLength); 1162var expectedError = new Http2StreamErrorException(1, CoreStrings.Http2StreamErrorMoreDataThanLength, Http2ErrorCode.PROTOCOL_ERROR); 1193await WaitForStreamErrorAsync(1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.Http2StreamErrorLessDataThanLength); 1197var expectedError = new Http2StreamErrorException(1, CoreStrings.Http2StreamErrorLessDataThanLength, Http2ErrorCode.PROTOCOL_ERROR); 1229await WaitForStreamErrorAsync(1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.Http2StreamErrorMoreDataThanLength); 1233var expectedError = new Http2StreamErrorException(1, CoreStrings.Http2StreamErrorMoreDataThanLength, Http2ErrorCode.PROTOCOL_ERROR); 1265await WaitForStreamErrorAsync(1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.Http2StreamErrorLessDataThanLength); 1269var expectedError = new Http2StreamErrorException(1, CoreStrings.Http2StreamErrorLessDataThanLength, Http2ErrorCode.PROTOCOL_ERROR); 1389await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, "Response Content-Length mismatch: too many bytes written (12 of 11)."); 1770await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, ""); 1804await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, ""); 1841await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, CoreStrings.FormatTooFewBytesWritten(6, 11)); 1924await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.NO_ERROR, null); 2011await WaitForStreamErrorAsync(1, Http2ErrorCode.NO_ERROR, null); 2074await WaitForStreamErrorAsync(1, Http2ErrorCode.NO_ERROR, null); 2235await WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames: false, int.MaxValue, Http2ErrorCode.INTERNAL_ERROR); 2586await WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames: false, int.MaxValue, Http2ErrorCode.INTERNAL_ERROR); 3149await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, "App Faulted"); 3360await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.INTERNAL_ERROR, CoreStrings.ConnectionAbortedByApplication); 3412await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.INTERNAL_ERROR, CoreStrings.ConnectionAbortedByApplication); 3437await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.INTERNAL_ERROR, CoreStrings.ConnectionAbortedByApplication); 3464await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.INTERNAL_ERROR, CoreStrings.ConnectionAbortedByApplication); 3854await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, null); 5343await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, 5414await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, 5493await Task.WhenAny(WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, expectedErrorMessage: null), appTcs.Task).Unwrap(); 5582await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, expectedErrorMessage: null); 5641resetFeature.Reset((int)Http2ErrorCode.NO_ERROR); 5668await WaitForStreamErrorAsync(1, Http2ErrorCode.NO_ERROR, expectedErrorMessage: 5730resetFeature.Reset((int)Http2ErrorCode.NO_ERROR); 5760await WaitForStreamErrorAsync(1, Http2ErrorCode.NO_ERROR, expectedErrorMessage: 5833expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 5854Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.BadRequest_MalformedRequestInvalidHeaders);
Http2\Http2TestBase.cs (11)
388resetFeature.Reset((int)Http2ErrorCode.CANCEL); 1145rstStreamFrame.PrepareRstStream(streamId, Http2ErrorCode.CANCEL); 1147BinaryPrimitives.WriteUInt32BigEndian(payload, (uint)Http2ErrorCode.CANCEL); 1157frame.PrepareRstStream(streamId, Http2ErrorCode.CANCEL); 1167frame.PrepareGoAway(0, Http2ErrorCode.NO_ERROR); 1176frame.PrepareGoAway(0, Http2ErrorCode.NO_ERROR); 1287return WaitForConnectionErrorAsync<Exception>(ignoreNonGoAwayFrames, expectedLastStreamId, Http2ErrorCode.NO_ERROR, expectedErrorMessage: null); 1290internal void VerifyGoAway(Http2Frame frame, int expectedLastStreamId, Http2ErrorCode expectedErrorCode) 1300internal async Task WaitForConnectionErrorAsync<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode, params string[] expectedErrorMessage) 1307internal async Task WaitForConnectionErrorAsyncDoNotCloseTransport<TException>(bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode, params string[] expectedErrorMessage) 1334internal async Task WaitForStreamErrorAsync(int expectedStreamId, Http2ErrorCode expectedErrorCode, string expectedErrorMessage)
Http2\Http2TimeoutTests.cs (11)
195Http2ErrorCode.INTERNAL_ERROR, 260await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, "The connection was aborted by the application."); 301Http2ErrorCode.STREAM_CLOSED, 496Http2ErrorCode.INTERNAL_ERROR, 550Http2ErrorCode.INTERNAL_ERROR, 616Http2ErrorCode.INTERNAL_ERROR, 663Http2ErrorCode.INTERNAL_ERROR, 714Http2ErrorCode.INTERNAL_ERROR, 781Http2ErrorCode.INTERNAL_ERROR, 849Http2ErrorCode.INTERNAL_ERROR, 990Http2ErrorCode.INTERNAL_ERROR,
Http2\Http2WebSocketTests.cs (2)
297await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.ConnectRequestsWithProtocolRequireSchemeAndPath); 317await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.ProtocolRequiresConnect);
Http2\TlsTests.cs (2)
75await WaitForConnectionErrorAsync(reader, ignoreNonGoAwayFrames: false, expectedLastStreamId: 0, expectedErrorCode: Http2ErrorCode.INADEQUATE_SECURITY); 83private async Task WaitForConnectionErrorAsync(PipeReader reader, bool ignoreNonGoAwayFrames, int expectedLastStreamId, Http2ErrorCode expectedErrorCode)
Microsoft.AspNetCore.Server.Kestrel.Core (108)
Internal\Http2\FlowControl\InputFlowControl.cs (1)
56throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorFlowControlWindowExceeded, Http2ErrorCode.FLOW_CONTROL_ERROR, ConnectionEndReason.FlowControlWindowExceeded);
Internal\Http2\Http2Connection.cs (62)
229SetConnectionErrorCode(hasActiveStreams ? ConnectionEndReason.ConnectionReset : ConnectionEndReason.TransportCompleted, Http2ErrorCode.NO_ERROR); 235private void SetConnectionErrorCode(ConnectionEndReason reason, Http2ErrorCode errorCode) 244Abort(ex, Http2ErrorCode.INTERNAL_ERROR, reason); 247public void Abort(ConnectionAbortedException ex, Http2ErrorCode errorCode, ConnectionEndReason reason) 264Abort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestHeadersTimeout), Http2ErrorCode.INTERNAL_ERROR, ConnectionEndReason.RequestHeadersTimeout); 272Abort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestBodyTimeout), Http2ErrorCode.INTERNAL_ERROR, ConnectionEndReason.MinRequestBodyDataRate); 289var errorCode = Http2ErrorCode.NO_ERROR; 378throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorKeepAliveTimeout, Http2ErrorCode.INTERNAL_ERROR, ConnectionEndReason.KeepAliveTimeout); 429errorCode = Http2ErrorCode.COMPRESSION_ERROR; 436errorCode = Http2ErrorCode.INTERNAL_ERROR; 513throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorMinTlsVersion(tlsFeature.Protocol), Http2ErrorCode.INADEQUATE_SECURITY, ConnectionEndReason.InsufficientTlsVersion); 598SetConnectionErrorCode(ConnectionEndReason.InvalidHttpVersion, Http2ErrorCode.PROTOCOL_ERROR); 613throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorInvalidPreface, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidHandshake); 685throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdEven(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidStreamId); 695Http2FrameType.PUSH_PROMISE => throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorPushPromiseReceived, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.UnexpectedFrame), 718throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorPaddingTooLong(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidDataPadding); 740throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamHalfClosedRemote(_incomingFrame.Type, stream.StreamId), Http2ErrorCode.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose); 757throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.STREAM_CLOSED, ConnectionEndReason.UnknownStream); 762return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamAborted(_incomingFrame.Type, stream.StreamId), Http2ErrorCode.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose); 767return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdZero(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidStreamId); 772return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdNotZero(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidStreamId); 778return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorHeadersInterleaved(_incomingFrame.Type, _incomingFrame.StreamId, _currentHeadersStream.StreamId), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.UnexpectedFrame); 783return new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorUnexpectedFrameLength(_incomingFrame.Type, expectedLength), Http2ErrorCode.FRAME_SIZE_ERROR, ConnectionEndReason.InvalidFrameLength); 800throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorPaddingTooLong(_incomingFrame.Type), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidDataPadding); 805throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamSelfDependency(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.StreamSelfDependency); 825throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamHalfClosedRemote(_incomingFrame.Type, stream.StreamId), Http2ErrorCode.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose); 831throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorHeadersWithTrailersNoEndStream, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.MissingStreamEnd); 850throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.STREAM_CLOSED, ConnectionEndReason.InvalidStreamId); 928throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamSelfDependency(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.StreamSelfDependency); 995throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorSettingsAckLengthNotZero, Http2ErrorCode.FRAME_SIZE_ERROR, ConnectionEndReason.InvalidFrameLength); 1003throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorSettingsLengthNotMultipleOfSix, Http2ErrorCode.FRAME_SIZE_ERROR, ConnectionEndReason.InvalidFrameLength); 1037throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorInitialWindowSizeInvalid, Http2ErrorCode.FLOW_CONTROL_ERROR, ConnectionEndReason.InvalidSettings); 1055var errorCode = ex.Parameter == Http2SettingsParameter.SETTINGS_INITIAL_WINDOW_SIZE 1056? Http2ErrorCode.FLOW_CONTROL_ERROR 1057: Http2ErrorCode.PROTOCOL_ERROR; 1147throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorWindowUpdateIncrementZero, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidWindowUpdateSize); 1154throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorWindowUpdateSizeInvalid, Http2ErrorCode.FLOW_CONTROL_ERROR, ConnectionEndReason.InvalidWindowUpdateSize); 1167throw new Http2StreamErrorException(_incomingFrame.StreamId, CoreStrings.Http2ErrorWindowUpdateSizeInvalid, Http2ErrorCode.FLOW_CONTROL_ERROR); 1184throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorContinuationWithNoHeaders, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.UnexpectedFrame); 1289throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.HttpErrorMissingMandatoryPseudoHeaderFields, Http2ErrorCode.PROTOCOL_ERROR); 1302throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2ErrorMaxStreams, Http2ErrorCode.REFUSED_STREAM); 1322Abort(new ConnectionAbortedException(CoreStrings.Http2ConnectionFaulted), Http2ErrorCode.ENHANCE_YOUR_CALM, ConnectionEndReason.StreamResetLimitExceeded); 1324throw new Http2ConnectionErrorException(CoreStrings.Http2ConnectionFaulted, Http2ErrorCode.ENHANCE_YOUR_CALM, ConnectionEndReason.StreamResetLimitExceeded); 1327throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2TellClientToCalmDown, Http2ErrorCode.ENHANCE_YOUR_CALM); 1383throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdle(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidStreamId); 1439throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose); 1507_frameWriter.WriteGoAwayAsync(int.MaxValue, Http2ErrorCode.NO_ERROR).Preserve(); 1517SetConnectionErrorCode(_gracefulCloseReason, Http2ErrorCode.NO_ERROR); 1518_frameWriter.WriteGoAwayAsync(_highestOpenedStreamId, Http2ErrorCode.NO_ERROR).Preserve(); 1583throw new Http2ConnectionErrorException(CoreStrings.BadRequest_HeadersExceedMaxTotalSize, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.MaxRequestHeadersTotalSizeExceeded); 1645throw new Http2ConnectionErrorException(bre.Message, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.MaxRequestHeaderCountExceeded); 1650throw new Http2ConnectionErrorException(bre.Message, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1654throw new Http2ConnectionErrorException(CoreStrings.BadRequest_MalformedRequestInvalidHeaders, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1665throw new Http2ConnectionErrorException(CoreStrings.HttpErrorConnectionSpecificHeaderField, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1676throw new Http2ConnectionErrorException(CoreStrings.HttpErrorTrailerNameUppercase, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1680throw new Http2ConnectionErrorException(CoreStrings.HttpErrorHeaderNameUppercase, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1709throw new Http2ConnectionErrorException(CoreStrings.HttpErrorPseudoHeaderFieldAfterRegularHeaders, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1715throw new Http2ConnectionErrorException(CoreStrings.HttpErrorTrailersContainPseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1724throw new Http2ConnectionErrorException(CoreStrings.HttpErrorUnknownPseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1731throw new Http2ConnectionErrorException(CoreStrings.HttpErrorResponsePseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1738throw new Http2ConnectionErrorException(CoreStrings.HttpErrorDuplicatePseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders);
Internal\Http2\Http2FrameWriter.cs (8)
172_http2Connection.Abort(ex, Http2ErrorCode.INTERNAL_ERROR, ConnectionEndReason.OutputQueueSizeExceeded); 353const 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); 875public ValueTask<FlushResult> WriteRstStreamAsync(int streamId, Http2ErrorCode errorCode) 987public 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)
58private Http2ErrorCode? _resetErrorCode; 250_stream.ResetAndAbort(abortReason, Http2ErrorCode.INTERNAL_ERROR); 255_stream.ResetAndAbort(new ConnectionAbortedException($"{nameof(Http2OutputProducer)} has completed."), Http2ErrorCode.INTERNAL_ERROR); 439public ValueTask<FlushResult> WriteRstStreamAsync(Http2ErrorCode error)
Internal\Http2\Http2Stream.cs (17)
171_ = _http2Output.WriteRstStreamAsync(Http2ErrorCode.NO_ERROR).Preserve(); 269ResetAndAbort(new ConnectionAbortedException(CoreStrings.ConnectRequestsWithProtocolRequireSchemeAndPath), Http2ErrorCode.PROTOCOL_ERROR); 278ResetAndAbort(new ConnectionAbortedException(CoreStrings.Http2ErrorConnectMustNotSendSchemeOrPath), Http2ErrorCode.PROTOCOL_ERROR); 289ResetAndAbort(new ConnectionAbortedException(CoreStrings.ProtocolRequiresConnect), Http2ErrorCode.PROTOCOL_ERROR); 305CoreStrings.FormatHttp2StreamErrorSchemeMismatch(headerScheme, Scheme)), Http2ErrorCode.PROTOCOL_ERROR); 336ResetAndAbort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestLineTooLong), Http2ErrorCode.PROTOCOL_ERROR); 356ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2ErrorMethodInvalid(_methodText)), Http2ErrorCode.PROTOCOL_ERROR); 364ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2ErrorMethodInvalid(_methodText)), Http2ErrorCode.PROTOCOL_ERROR); 404ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatBadRequest_InvalidHostHeader_Detail(hostText)), Http2ErrorCode.PROTOCOL_ERROR); 417ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2StreamErrorPathInvalid(RawTarget)), Http2ErrorCode.PROTOCOL_ERROR); 456ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2StreamErrorPathInvalid(RawTarget)), Http2ErrorCode.PROTOCOL_ERROR); 495throw new Http2StreamErrorException(StreamId, CoreStrings.Http2StreamErrorMoreDataThanLength, Http2ErrorCode.PROTOCOL_ERROR); 540throw new Http2StreamErrorException(StreamId, CoreStrings.Http2StreamErrorLessDataThanLength, Http2ErrorCode.PROTOCOL_ERROR); 585ResetAndAbort(abortReason, Http2ErrorCode.INTERNAL_ERROR); 588protected override void ApplicationAbort() => ApplicationAbort(new ConnectionAbortedException(CoreStrings.ConnectionAbortedByApplication), Http2ErrorCode.INTERNAL_ERROR); 590private void ApplicationAbort(ConnectionAbortedException abortReason, Http2ErrorCode error) 595internal void ResetAndAbort(ConnectionAbortedException abortReason, Http2ErrorCode error)
Internal\Http2\Http2Stream.FeatureCollection.cs (2)
64var abortReason = new ConnectionAbortedException(CoreStrings.FormatHttp2StreamResetByApplication((Http2ErrorCode)errorCode)); 65ApplicationAbort(abortReason, (Http2ErrorCode)errorCode);
Internal\Http2\Http2StreamErrorException.cs (2)
8public Http2StreamErrorException(int streamId, string message, Http2ErrorCode errorCode) 17public Http2ErrorCode ErrorCode { get; }
Internal\Infrastructure\KestrelTrace.Http2.cs (2)
27public void Http2StreamResetAbort(string traceIdentifier, Http2ErrorCode error, ConnectionAbortedException abortReason) 115public static partial void Http2StreamResetAbort(ILogger logger, string traceIdentifier, Http2ErrorCode error, ConnectionAbortedException abortReason);
src\Shared\ServerInfrastructure\Http2\Http2ConnectionErrorException.cs (2)
10public Http2ConnectionErrorException(string message, Http2ErrorCode errorCode, ConnectionEndReason reason) 17public Http2ErrorCode ErrorCode { get; }
src\Shared\ServerInfrastructure\Http2\Http2Frame.GoAway.cs (2)
19public Http2ErrorCode GoAwayErrorCode { get; set; } 21public void PrepareGoAway(int lastStreamId, Http2ErrorCode errorCode)
src\Shared\ServerInfrastructure\Http2\Http2Frame.RstStream.cs (2)
13public Http2ErrorCode RstStreamErrorCode { get; set; } 15public void PrepareRstStream(int streamId, Http2ErrorCode errorCode)
src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (4)
54throw new Http2ConnectionErrorException(SharedStrings.FormatHttp2ErrorFrameOverLimit(payloadLength, maxFrameSize), Http2ErrorCode.FRAME_SIZE_ERROR, ConnectionEndReason.MaxFrameLengthExceeded); 86SharedStrings.FormatHttp2ErrorUnexpectedFrameLength(frame.Type, expectedLength: extendedHeaderLength), Http2ErrorCode.FRAME_SIZE_ERROR, ConnectionEndReason.InvalidFrameLength); 154frame.GoAwayErrorCode = (Http2ErrorCode)BinaryPrimitives.ReadUInt32BigEndian(extendedHeaders.Slice(4)); 175frame.RstStreamErrorCode = (Http2ErrorCode)BinaryPrimitives.ReadUInt32BigEndian(extendedHeaders);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Http2\Http2FrameWriterTests.cs (1)
64await frameWriter.WriteGoAwayAsync(1, Http2ErrorCode.NO_ERROR);