Пример #1
0
 public Task StopAcceptingWritesAsync()
 {
     // Can't use dispose (or close) as can be disposed too early by user code
     // As exampled in EngineTests.ZeroContentLengthNotSetAutomaticallyForCertainStatusCodes
     _state = HttpStreamState.Closed;
     return(_completeTask);
 }
Пример #2
0
 public void StopAcceptingReads()
 {
     // Can't use dispose (or close) as can be disposed too early by user code
     // As exampled in EngineTests.ZeroContentLengthNotSetAutomaticallyForCertainStatusCodes
     _state = HttpStreamState.Closed;
     _body  = null;
 }
Пример #3
0
 public void StartAcceptingWrites()
 {
     // Only start if not aborted
     if (_state == HttpStreamState.Closed)
     {
         _state = HttpStreamState.Open;
     }
 }
Пример #4
0
 public void Abort()
 {
     // We don't want to throw an ODE until the app func actually completes.
     if (_state != HttpStreamState.Closed)
     {
         _state = HttpStreamState.Aborted;
     }
 }
Пример #5
0
 public void StartAcceptingReads(MessageBody body)
 {
     // Only start if not aborted
     if (_state == HttpStreamState.Closed)
     {
         _state = HttpStreamState.Open;
         _body  = body;
     }
 }
Пример #6
0
 public void StartAcceptingReads(IISHttpContext body)
 {
     // Only start if not aborted
     if (_state == HttpStreamState.Closed)
     {
         _state = HttpStreamState.Open;
         _body  = body;
     }
 }
Пример #7
0
 public void Abort(Exception?error = null)
 {
     // We don't want to throw an ODE until the app func actually completes.
     // If the request is aborted, we throw a TaskCanceledException instead,
     // unless error is not null, in which case we throw it.
     if (_state != HttpStreamState.Closed)
     {
         _state = HttpStreamState.Aborted;
         _error = error;
     }
 }
Пример #8
0
        public void Abort(Exception error = null)
        {
            // We don't want to throw an ODE until the app func actually completes.
            // If the request is aborted, we throw a TaskCanceledException instead,
            // unless error is not null, in which case we throw it.
            if (_state != HttpStreamState.Closed)
            {
                _state = HttpStreamState.Aborted;

                if (error is object && _error is null)
                {
                    _error = ExceptionDispatchInfo.Capture(error);
                }
            }
        }
Пример #9
0
    public void Abort(Exception?error = null)
    {
        // If the request is aborted, we throw a TaskCanceledException instead,
        // unless error is not null, in which case we throw it.

        if (error is not null)
        {
            _error ??= ExceptionDispatchInfo.Capture(error);
        }
        else
        {
            // Do not change state if there is an error because we don't want to throw a TaskCanceledException
            // and we do not want to introduce any memory barriers at this layer. This is just for reporting errors
            // early when we know the transport will fail.
            _state = HttpStreamState.Aborted;
        }
    }
Пример #10
0
 public HttpRequestStream()
 {
     _state = HttpStreamState.Closed;
 }
Пример #11
0
 public HttpRequestStream(IHttpBodyControlFeature bodyControl)
 {
     _bodyControl = bodyControl;
     _state       = HttpStreamState.Closed;
 }
Пример #12
0
 public HttpRequestStream(bool allowSynchronousIO)
 {
     _allowSynchronousIO = allowSynchronousIO;
     _state = HttpStreamState.Closed;
 }
 public HttpResponseStream(IHttpBodyControlFeature bodyControl, IHttpResponseControl httpResponseControl)
 {
     _bodyControl         = bodyControl;
     _httpResponseControl = httpResponseControl;
     _state = HttpStreamState.Closed;
 }
Пример #14
0
 public EmptyStream(IHttpBodyControlFeature bodyControl)
 {
     _bodyControl = bodyControl;
     _state       = HttpStreamState.Open;
 }
Пример #15
0
 public HttpRequestPipeReader()
 {
     _state = HttpStreamState.Closed;
 }
Пример #16
0
 public HttpResponsePipeWriter(IHttpResponseControl pipeControl)
 {
     _pipeControl = pipeControl;
     _state       = HttpStreamState.Closed;
 }
Пример #17
0
 public HttpResponseStream(bool allowSynchronousIO, IHttpResponseControl httpResponseControl)
 {
     _allowSynchronousIO  = allowSynchronousIO;
     _httpResponseControl = httpResponseControl;
     _state = HttpStreamState.Closed;
 }
Пример #18
0
 public HttpResponseStream(IHttpResponseControl httpResponseControl)
 {
     _httpResponseControl = httpResponseControl;
     _state = HttpStreamState.Closed;
 }
Пример #19
0
 public HttpResponseStream(IHttpBodyControlFeature bodyControl, IISHttpContext context)
 {
     _bodyControl = bodyControl;
     _context     = context;
     _state       = HttpStreamState.Closed;
 }