TeChunkedParser.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_SRC_HTTP_ONE_TeChunkedParser_H
10#define SQUID_SRC_HTTP_ONE_TeChunkedParser_H
11
12#include "http/one/Parser.h"
13
14class MemBuf;
15
16namespace Http
17{
18namespace One
19{
20
21using ::Parser::InsufficientInput;
22
23// TODO: Move this class into http/one/ChunkExtensionValueParser.*
30{
31public:
33
35 static void Ignore(Tokenizer &tok, const SBuf &extName);
36
38 virtual void parse(Tokenizer &tok, const SBuf &extName) = 0;
39};
40
52{
53public:
55 virtual ~TeChunkedParser() { theOut=nullptr; /* we do not own this object */ }
56
58 void setPayloadBuffer(MemBuf *parsedContent) {theOut = parsedContent;}
59
63
64 bool needsMoreSpace() const;
65
66 /* Http1::Parser API */
67 virtual void clear();
68 virtual bool parse(const SBuf &);
69 virtual Parser::size_type firstLineSize() const {return 0;} // has no meaning with multiple chunks
70
71private:
78
80 uint64_t theChunkSize;
82
86};
87
88} // namespace One
89} // namespace Http
90
91#endif /* SQUID_SRC_HTTP_ONE_TeChunkedParser_H */
92
static void Ignore(Tokenizer &tok, const SBuf &extName)
extracts and ignores the value of a named extension
virtual void parse(Tokenizer &tok, const SBuf &extName)=0
extracts and then interprets (or ignores) the extension value
SBuf::size_type size_type
Definition: Parser.h:43
::Parser::Tokenizer Tokenizer
Definition: Parser.h:44
bool parseChunkBody(Tokenizer &tok)
ChunkExtensionValueParser * customExtensionValueParser
void parseChunkExtensions(Tokenizer &)
bool parseChunkSize(Tokenizer &tok)
RFC 7230 section 4.1 chunk-size.
void parseOneChunkExtension(Tokenizer &)
virtual Parser::size_type firstLineSize() const
size in bytes of the first line including CRLF terminator
void parseExtensionValuesWith(ChunkExtensionValueParser *parser)
bool parseChunkEnd(Tokenizer &tok)
bool parseChunkMetadataSuffix(Tokenizer &)
virtual bool parse(const SBuf &)
void setPayloadBuffer(MemBuf *parsedContent)
set the buffer to be used to store decoded chunk data
Definition: MemBuf.h:24
Definition: SBuf.h:94
Definition: forward.h:22
Definition: parse.c:160

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors