示例#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;
 }
 public HttpResponseStream(IHttpResponseControl httpResponseControl)
 {
     _httpResponseControl = httpResponseControl;
     _state = HttpStreamState.Closed;
 }
示例#19
0
 public HttpResponseStream(IHttpBodyControlFeature bodyControl, IISHttpContext context)
 {
     _bodyControl = bodyControl;
     _context     = context;
     _state       = HttpStreamState.Closed;
 }