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