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); }
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; }
public void StartAcceptingWrites() { // Only start if not aborted if (_state == HttpStreamState.Closed) { _state = HttpStreamState.Open; } }
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; } }
public void StartAcceptingReads(IISHttpContext body) { // Only start if not aborted if (_state == HttpStreamState.Closed) { _state = HttpStreamState.Open; _body = body; } }
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; } }
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; } }
public HttpRequestStream() { _state = HttpStreamState.Closed; }
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; }
public EmptyStream(IHttpBodyControlFeature bodyControl) { _bodyControl = bodyControl; _state = HttpStreamState.Open; }
public HttpRequestPipeReader() { _state = HttpStreamState.Closed; }
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; }
public HttpResponseStream(IHttpBodyControlFeature bodyControl, IISHttpContext context) { _bodyControl = bodyControl; _context = context; _state = HttpStreamState.Closed; }