示例#1
0
        public void Abort(ConnectionAbortedException abortReason, Http3ErrorCode errorCode)
        {
            lock (_completionLock)
            {
                if (IsCompleted)
                {
                    return;
                }

                var(oldState, newState) = ApplyCompletionFlag(StreamCompletionFlags.Aborted);

                if (oldState == newState)
                {
                    return;
                }

                Log.Http3StreamAbort(TraceIdentifier, errorCode, abortReason);

                _errorCodeFeature.Error = (long)errorCode;
                _frameWriter.Abort(abortReason);

                // Call _http3Output.Stop() prior to poisoning the request body stream or pipe to
                // ensure that an app that completes early due to the abort doesn't result in header frames being sent.
                _http3Output.Stop();

                CancelRequestAbortedToken();

                // Unblock the request body.
                PoisonBody(abortReason);
                RequestBodyPipe.Writer.Complete(abortReason);
            }
        }
示例#2
0
        public void Abort(ConnectionAbortedException abortReason, Http3ErrorCode errorCode)
        {
            // TODO - Should there be a check here to track abort state to avoid
            // running twice for a request?

            Log.Http3StreamAbort(TraceIdentifier, errorCode, abortReason);

            _errorCodeFeature.Error = (long)errorCode;
            _frameWriter.Abort(abortReason);

            // Call _http3Output.Stop() prior to poisoning the request body stream or pipe to
            // ensure that an app that completes early due to the abort doesn't result in header frames being sent.
            _http3Output.Stop();

            CancelRequestAbortedToken();

            // Unblock the request body.
            PoisonBody(abortReason);
            RequestBodyPipe.Writer.Complete(abortReason);
        }