Пример #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);
        }
Пример #2
0
        private void WriteBeginResponseHeaders()
        {
            if (HasStarted)
            {
                return;
            }

            HasStarted = true;

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

            _outputFormatter.Write(status);

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

            ResponseHeaders.CopyTo(_autoChunk, _outputFormatter);
        }