Пример #1
0
        public byte[] ReadHeaders(bool checker = false)
        {
            byte[] readLine = GetHeader(parser.ReadLine(NewLine));

            if (readLine == null)
            {
                return(default);
Пример #2
0
        private void HandleAfterHeaders()
        {
            byte[] readLine = parser.ReadLine(Separator);
            if (!CheckAndReadBytes(readLine, 0))
            {
                InitializeParser(buffer);
                HandleAfterHeaders();
            }

            if (readLine == null || Encoding.UTF8.GetString(readLine) == Separator)
            {
                return;
            }

            byte[] toSend = readLine.Concat(
                parser.ReadLine(Headers.EmptyLine))
                            .ToArray();

            chunkHandler.HandleResponseBody(toSend, Convert.ToString(toSend.Length));
        }