@@ -101,6 +101,9 @@ private void UpdateHighestOpenedRequestStreamId(long streamId)
101101 public string ConnectionId => _context . ConnectionId ;
102102 public ITimeoutControl TimeoutControl => _context . TimeoutControl ;
103103
104+ // The default error value is -1. If it hasn't been changed before abort is called then default to HTTP/3's NoError value.
105+ private Http3ErrorCode Http3ErrorCodeOrNoError => _errorCodeFeature . Error == - 1 ? Http3ErrorCode . NoError : ( Http3ErrorCode ) _errorCodeFeature . Error ;
106+
104107 public void StopProcessingNextRequest ( ConnectionEndReason reason )
105108 => StopProcessingNextRequest ( serverInitiated : true , reason ) ;
106109
@@ -505,7 +508,7 @@ public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> appl
505508 }
506509 }
507510
508- var errorCode = GetErrorCodeOrNoError ( ) ;
511+ var errorCode = Http3ErrorCodeOrNoError ;
509512
510513 // Abort active request streams.
511514 lock ( _streams )
@@ -907,7 +910,7 @@ public void OnInputOrOutputCompleted()
907910 TryStopAcceptingStreams ( ) ;
908911
909912 // Abort the connection using the error code the client used. For a graceful close, this should be H3_NO_ERROR.
910- Abort ( new ConnectionAbortedException ( CoreStrings . ConnectionAbortedByClient ) , GetErrorCodeOrNoError ( ) , ConnectionEndReason . TransportCompleted ) ;
913+ Abort ( new ConnectionAbortedException ( CoreStrings . ConnectionAbortedByClient ) , Http3ErrorCodeOrNoError , ConnectionEndReason . TransportCompleted ) ;
911914 }
912915
913916 internal WebTransportSession OpenNewWebTransportSession ( Http3Stream http3Stream )
@@ -925,12 +928,6 @@ internal WebTransportSession OpenNewWebTransportSession(Http3Stream http3Stream)
925928 return session ;
926929 }
927930
928- private Http3ErrorCode GetErrorCodeOrNoError ( )
929- {
930- // The default error value is -1. If it hasn't been changed before abort is called then default to HTTP/3's NoError value.
931- return _errorCodeFeature . Error == - 1 ? Http3ErrorCode . NoError : ( Http3ErrorCode ) _errorCodeFeature . Error ;
932- }
933-
934931 private static class GracefulCloseInitiator
935932 {
936933 public const int None = 0 ;
0 commit comments