Exemple #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);
 }
Exemple #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;
 }
Exemple #3
0
 public void StartAcceptingWrites()
 {
     // Only start if not aborted
     if (_state == HttpStreamState.Closed)
     {
         _state = HttpStreamState.Open;
     }
 }
Exemple #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;
     }
 }
 public void StartAcceptingReads(MessageBody body)
 {
     // Only start if not aborted
     if (_state == HttpStreamState.Closed)
     {
         _state = HttpStreamState.Open;
         _body  = body;
     }
 }
Exemple #6
0
 public void StartAcceptingReads(IISHttpContext body)
 {
     // Only start if not aborted
     if (_state == HttpStreamState.Closed)
     {
         _state = HttpStreamState.Open;
         _body  = body;
     }
 }
Exemple #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;
     }
 }
Exemple #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);
                }
            }
        }
    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;
        }
    }
Exemple #10
0
 public HttpRequestStream()
 {
     _state = HttpStreamState.Closed;
 }
Exemple #11
0
 public HttpRequestStream(IHttpBodyControlFeature bodyControl)
 {
     _bodyControl = bodyControl;
     _state       = HttpStreamState.Closed;
 }
 public HttpRequestStream(bool allowSynchronousIO)
 {
     _allowSynchronousIO = allowSynchronousIO;
     _state = HttpStreamState.Closed;
 }
 public HttpResponseStream(IHttpBodyControlFeature bodyControl, IHttpResponseControl httpResponseControl)
 {
     _bodyControl         = bodyControl;
     _httpResponseControl = httpResponseControl;
     _state = HttpStreamState.Closed;
 }
Exemple #14
0
 public EmptyStream(IHttpBodyControlFeature bodyControl)
 {
     _bodyControl = bodyControl;
     _state       = HttpStreamState.Open;
 }
 public HttpRequestPipeReader()
 {
     _state = HttpStreamState.Closed;
 }
Exemple #16
0
 public HttpResponsePipeWriter(IHttpResponseControl pipeControl)
 {
     _pipeControl = pipeControl;
     _state       = HttpStreamState.Closed;
 }
 public HttpResponseStream(bool allowSynchronousIO, IHttpResponseControl httpResponseControl)
 {
     _allowSynchronousIO  = allowSynchronousIO;
     _httpResponseControl = httpResponseControl;
     _state = HttpStreamState.Closed;
 }
 public HttpResponseStream(IHttpResponseControl httpResponseControl)
 {
     _httpResponseControl = httpResponseControl;
     _state = HttpStreamState.Closed;
 }
Exemple #19
0
 public HttpResponseStream(IHttpBodyControlFeature bodyControl, IISHttpContext context)
 {
     _bodyControl = bodyControl;
     _context     = context;
     _state       = HttpStreamState.Closed;
 }