Ejemplo n.º 1
0
        private void WriteBeginResponseHeaders(ref WritableBuffer buffer, ref bool autoChunk)
        {
            if (HasStarted)
            {
                return;
            }

            HasStarted = true;

            buffer.Write(_http11Bytes.Slice());
            var status = ReasonPhrases.ToStatusBytes(StatusCode);

            buffer.Write(status.Slice());

            autoChunk = !HasContentLength && !HasTransferEncoding && KeepAlive;

            ResponseHeaders.CopyTo(autoChunk, ref buffer);
        }
Ejemplo n.º 2
0
        private void WriteBeginResponseHeaders(PipeWriter buffer)
        {
            if (HasStarted)
            {
                return;
            }

            HasStarted = true;

            buffer.Write(_http11Bytes);
            var status = ReasonPhrases.ToStatusBytes(StatusCode);

            buffer.Write(status);

            _autoChunk = !HasContentLength && !HasTransferEncoding && KeepAlive;

            ResponseHeaders.CopyTo(_autoChunk, buffer);
        }
Ejemplo n.º 3
0
        private void WriteBeginResponseHeaders()
        {
            if (HasStarted)
            {
                return;
            }

            HasStarted = true;
            
            if (_isHttp2)
            {
                throw new NotImplementedException();
            }
            else
            {
                _outputFormatter.Write(_http11Bytes);
                var status = ReasonPhrases.ToStatusBytes(StatusCode);
                _outputFormatter.Write(status);

                _autoChunk = !HasContentLength && !HasTransferEncoding && KeepAlive;

                ResponseHeaders.CopyTo(_autoChunk, _outputFormatter);
            }
        }