Example #1
0
        public void Reset()
        {
            _onStarting  = null;
            _onCompleted = null;

            _responseStarted = false;
            _keepAlive       = false;
            _autoChunk       = false;

            _requestHeaders.Reset();
            ResetResponseHeaders();

            Method          = null;
            RequestUri      = null;
            Path            = null;
            QueryString     = null;
            HttpVersion     = null;
            RequestHeaders  = _requestHeaders;
            MessageBody     = null;
            RequestBody     = null;
            StatusCode      = 200;
            ReasonPhrase    = null;
            ResponseHeaders = _responseHeaders;
            ResponseBody    = null;
            DuplexStream    = null;
        }
Example #2
0
        public void Reset()
        {
            _onStarting  = null;
            _onCompleted = null;

            _responseStarted      = false;
            _keepAlive            = false;
            _autoChunk            = false;
            _applicationException = null;

            _requestHeaders.Reset();
            ResetResponseHeaders();
            ResetFeatureCollection();

            Scheme          = null;
            Method          = null;
            RequestUri      = null;
            PathBase        = null;
            Path            = null;
            QueryString     = null;
            _httpVersion    = HttpVersionType.Unknown;
            RequestHeaders  = _requestHeaders;
            RequestBody     = null;
            StatusCode      = 200;
            ReasonPhrase    = null;
            ResponseHeaders = _responseHeaders;
            ResponseBody    = null;
            DuplexStream    = null;

            var httpConnectionFeature = this as IHttpConnectionFeature;

            httpConnectionFeature.RemoteIpAddress = _remoteEndPoint?.Address;
            httpConnectionFeature.RemotePort      = _remoteEndPoint?.Port ?? 0;

            httpConnectionFeature.LocalIpAddress = _localEndPoint?.Address;
            httpConnectionFeature.LocalPort      = _localEndPoint?.Port ?? 0;

            if (_remoteEndPoint != null && _localEndPoint != null)
            {
                httpConnectionFeature.IsLocal = _remoteEndPoint.Address.Equals(_localEndPoint.Address);
            }
            else
            {
                httpConnectionFeature.IsLocal = false;
            }

            _prepareRequest?.Invoke(this);

            _manuallySetRequestAbortToken = null;
            _abortedCts = null;
        }