297 references to Http2ErrorCode
InMemory.FunctionalTests (187)
Http2\Http2ConnectionTests.cs (115)
47await WaitForStreamErrorAsync(5, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 623await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, null); 639await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 664await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 738expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 1373await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.NO_ERROR, null); 1502expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1517expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1533expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1549expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1565expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 1581expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1596expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 1614expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 1637expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 1763expectedErrorCode: Http2ErrorCode.ENHANCE_YOUR_CALM, 1782expectedErrorCode: Http2ErrorCode.ENHANCE_YOUR_CALM, 1793expectedErrorCode: Http2ErrorCode.ENHANCE_YOUR_CALM, 1820expectedErrorCode: Http2ErrorCode.ENHANCE_YOUR_CALM, 1853expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 1877expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 1908expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 2323await WaitForStreamErrorAsync(1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.Http2StreamErrorLessDataThanLength); 2590await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 2612expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2628expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2653expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 2675expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 2699expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 2718expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2734expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 2752expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2805expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2822expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2838expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2854expectedErrorCode: Http2ErrorCode.COMPRESSION_ERROR, 2884expectedErrorCode: Http2ErrorCode.COMPRESSION_ERROR, 2902expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2922expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 2938expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3023expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3038expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3046expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 3211await WaitForStreamErrorAsync(1, Http2ErrorCode.PROTOCOL_ERROR, CoreStrings.BadRequest_RequestLineTooLong); 3255expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3271expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3289expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 3306expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3322expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3580expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3596expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3612expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3633expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 3650expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3677Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.DATA, 1)); 3704Http2ErrorCode.STREAM_CLOSED, CoreStrings.FormatHttp2ErrorStreamAborted(Http2FrameType.HEADERS, 1)); 3761await WaitForStreamErrorAsync(expectedStreamId: 1, Http2ErrorCode.STREAM_CLOSED, CoreStrings.Http2StreamAborted); 3913expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3920[InlineData((int)(Http2SettingsParameter.SETTINGS_ENABLE_PUSH), 2, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3921[InlineData((int)(Http2SettingsParameter.SETTINGS_ENABLE_PUSH), uint.MaxValue, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3922[InlineData((int)(Http2SettingsParameter.SETTINGS_INITIAL_WINDOW_SIZE), (uint)int.MaxValue + 1, (int)(Http2ErrorCode.FLOW_CONTROL_ERROR))] 3923[InlineData((int)(Http2SettingsParameter.SETTINGS_INITIAL_WINDOW_SIZE), uint.MaxValue, (int)(Http2ErrorCode.FLOW_CONTROL_ERROR))] 3924[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), 0, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3925[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), 1, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3926[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), 16 * 1024 - 1, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3927[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), 16 * 1024 * 1024, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3928[InlineData((int)(Http2SettingsParameter.SETTINGS_MAX_FRAME_SIZE), uint.MaxValue, (int)(Http2ErrorCode.PROTOCOL_ERROR))] 3932var expectedErrorCode = (Http2ErrorCode)intExpectedErrorCode; 3958expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 3976expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 3997expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 4023expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 4206expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4247expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4263expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4283expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 4557expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4574expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4590expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4607expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4627expectedErrorCode: Http2ErrorCode.FRAME_SIZE_ERROR, 4643expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4660expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4676expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 4695expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 4714expectedErrorCode: Http2ErrorCode.FLOW_CONTROL_ERROR, 5044expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 5061expectedErrorCode: Http2ErrorCode.COMPRESSION_ERROR, 5080expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 5097expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 5105expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 5202expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 5224expectedErrorCode: Http2ErrorCode.PROTOCOL_ERROR, 5286VerifyGoAway(await ReceiveFrameAsync(), int.MaxValue, Http2ErrorCode.INTERNAL_ERROR); 5300VerifyGoAway(await ReceiveFrameAsync(), 0, Http2ErrorCode.NO_ERROR); 5329VerifyGoAway(await ReceiveFrameAsync(), 3, Http2ErrorCode.NO_ERROR); 5361VerifyGoAway(await ReceiveFrameAsync(), Int32.MaxValue, Http2ErrorCode.NO_ERROR); 5379VerifyGoAway(await ReceiveFrameAsync(), 1, Http2ErrorCode.NO_ERROR); 5392VerifyGoAway(await ReceiveFrameAsync(), Int32.MaxValue, Http2ErrorCode.NO_ERROR); 5518await WaitForStreamErrorAsync(1, Http2ErrorCode.NO_ERROR, null); 5566await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, "The connection was aborted by the application."); 5612await WaitForStreamErrorAsync(1, Http2ErrorCode.CANCEL, "The HTTP/2 stream was reset by the application with error code CANCEL."); 5698await 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."); 5788await 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."); 5789await 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."); 5790await 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."); 5833await WaitForStreamErrorAsync(3, Http2ErrorCode.REFUSED_STREAM, CoreStrings.Http2ErrorMaxStreams); 5860await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, "The connection was aborted by the application."); 5873expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 5890expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 5908expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 5937await WaitForStreamErrorAsync(1, Http2ErrorCode.INTERNAL_ERROR, "The connection was aborted by the application."); 5960expectedErrorCode: Http2ErrorCode.STREAM_CLOSED, 6021expectedErrorCode: 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 (109)
Internal\Http2\FlowControl\InputFlowControl.cs (1)
56throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorFlowControlWindowExceeded, Http2ErrorCode.FLOW_CONTROL_ERROR, ConnectionEndReason.FlowControlWindowExceeded);
Internal\Http2\Http2Connection.cs (63)
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.FrameAfterStreamClose); 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); 1166throw new Http2StreamErrorException(_incomingFrame.StreamId, CoreStrings.Http2StreamAborted, Http2ErrorCode.STREAM_CLOSED); 1171throw new Http2StreamErrorException(_incomingFrame.StreamId, CoreStrings.Http2ErrorWindowUpdateSizeInvalid, Http2ErrorCode.FLOW_CONTROL_ERROR); 1188throw new Http2ConnectionErrorException(CoreStrings.Http2ErrorContinuationWithNoHeaders, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.UnexpectedFrame); 1302throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.HttpErrorMissingMandatoryPseudoHeaderFields, Http2ErrorCode.PROTOCOL_ERROR); 1315throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2ErrorMaxStreams, Http2ErrorCode.REFUSED_STREAM); 1335Abort(new ConnectionAbortedException(CoreStrings.Http2ConnectionFaulted), Http2ErrorCode.ENHANCE_YOUR_CALM, ConnectionEndReason.StreamResetLimitExceeded); 1337throw new Http2ConnectionErrorException(CoreStrings.Http2ConnectionFaulted, Http2ErrorCode.ENHANCE_YOUR_CALM, ConnectionEndReason.StreamResetLimitExceeded); 1340throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2TellClientToCalmDown, Http2ErrorCode.ENHANCE_YOUR_CALM); 1396throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamIdle(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidStreamId); 1452throw new Http2ConnectionErrorException(CoreStrings.FormatHttp2ErrorStreamClosed(_incomingFrame.Type, _incomingFrame.StreamId), Http2ErrorCode.STREAM_CLOSED, ConnectionEndReason.FrameAfterStreamClose); 1520_frameWriter.WriteGoAwayAsync(int.MaxValue, Http2ErrorCode.NO_ERROR).Preserve(); 1530SetConnectionErrorCode(_gracefulCloseReason, Http2ErrorCode.NO_ERROR); 1531_frameWriter.WriteGoAwayAsync(_highestOpenedStreamId, Http2ErrorCode.NO_ERROR).Preserve(); 1596throw new Http2ConnectionErrorException(CoreStrings.BadRequest_HeadersExceedMaxTotalSize, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.MaxRequestHeadersTotalSizeExceeded); 1658throw new Http2ConnectionErrorException(bre.Message, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.MaxRequestHeaderCountExceeded); 1663throw new Http2ConnectionErrorException(bre.Message, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1667throw new Http2ConnectionErrorException(CoreStrings.BadRequest_MalformedRequestInvalidHeaders, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1678throw new Http2ConnectionErrorException(CoreStrings.HttpErrorConnectionSpecificHeaderField, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1689throw new Http2ConnectionErrorException(CoreStrings.HttpErrorTrailerNameUppercase, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1693throw new Http2ConnectionErrorException(CoreStrings.HttpErrorHeaderNameUppercase, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1722throw new Http2ConnectionErrorException(CoreStrings.HttpErrorPseudoHeaderFieldAfterRegularHeaders, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1728throw new Http2ConnectionErrorException(CoreStrings.HttpErrorTrailersContainPseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1737throw new Http2ConnectionErrorException(CoreStrings.HttpErrorUnknownPseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1744throw new Http2ConnectionErrorException(CoreStrings.HttpErrorResponsePseudoHeaderField, Http2ErrorCode.PROTOCOL_ERROR, ConnectionEndReason.InvalidRequestHeaders); 1751throw 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)
170_ = _http2Output.WriteRstStreamAsync(Http2ErrorCode.NO_ERROR).Preserve(); 268ResetAndAbort(new ConnectionAbortedException(CoreStrings.ConnectRequestsWithProtocolRequireSchemeAndPath), Http2ErrorCode.PROTOCOL_ERROR); 277ResetAndAbort(new ConnectionAbortedException(CoreStrings.Http2ErrorConnectMustNotSendSchemeOrPath), Http2ErrorCode.PROTOCOL_ERROR); 288ResetAndAbort(new ConnectionAbortedException(CoreStrings.ProtocolRequiresConnect), Http2ErrorCode.PROTOCOL_ERROR); 304CoreStrings.FormatHttp2StreamErrorSchemeMismatch(headerScheme, Scheme)), Http2ErrorCode.PROTOCOL_ERROR); 335ResetAndAbort(new ConnectionAbortedException(CoreStrings.BadRequest_RequestLineTooLong), Http2ErrorCode.PROTOCOL_ERROR); 355ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2ErrorMethodInvalid(_methodText)), Http2ErrorCode.PROTOCOL_ERROR); 363ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2ErrorMethodInvalid(_methodText)), Http2ErrorCode.PROTOCOL_ERROR); 403ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatBadRequest_InvalidHostHeader_Detail(hostText)), Http2ErrorCode.PROTOCOL_ERROR); 416ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2StreamErrorPathInvalid(RawTarget)), Http2ErrorCode.PROTOCOL_ERROR); 455ResetAndAbort(new ConnectionAbortedException(CoreStrings.FormatHttp2StreamErrorPathInvalid(RawTarget)), Http2ErrorCode.PROTOCOL_ERROR); 494throw new Http2StreamErrorException(StreamId, CoreStrings.Http2StreamErrorMoreDataThanLength, Http2ErrorCode.PROTOCOL_ERROR); 539throw new Http2StreamErrorException(StreamId, CoreStrings.Http2StreamErrorLessDataThanLength, Http2ErrorCode.PROTOCOL_ERROR); 584ResetAndAbort(abortReason, Http2ErrorCode.INTERNAL_ERROR); 587protected override void ApplicationAbort() => ApplicationAbort(new ConnectionAbortedException(CoreStrings.ConnectionAbortedByApplication), Http2ErrorCode.INTERNAL_ERROR); 589private void ApplicationAbort(ConnectionAbortedException abortReason, Http2ErrorCode error) 594internal 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);