9#ifndef SQUID_SRC_HTTP_ONE_PARSER_H
10#define SQUID_SRC_HTTP_ONE_PARSER_H
55 virtual void clear() = 0;
#define RefCountable
The locking interface for use on Reference-Counted classes.
optimized set of C chars, with quick membership test and merge support
SBuf::size_type size_type
const AnyP::ProtocolVersion & messageProtocol() const
the protocol label for this message
Http::StatusCode parseStatusCode
char * getHostHeaderField()
AnyP::ProtocolVersion msgProtocol_
what protocol label has been found in the first line (if any)
Parser(Parser &&)=default
static const CharacterSet & WhitespaceCharacters()
bool hackExpectsMime_
Whether the invalid HTTP as HTTP/0.9 hack expects a mime header block.
SBuf buf_
bytes remaining to be parsed
void skipLineTerminator(Tokenizer &) const
const SBuf & remaining() const
the remaining unprocessed section of buffer
Parser(const Parser &)=default
bool grabMimeBlock(const char *which, const size_t limit)
ParseState parsingStage_
what stage the parser is currently up to
static const CharacterSet & DelimiterCharacters()
size_type headerBlockSize() const
virtual size_type firstLineSize() const =0
size in bytes of the first line including CRLF terminator
virtual bool parse(const SBuf &aBuf)=0
SBuf mimeHeader() const
buffer containing HTTP mime headers, excluding message first-line.
size_type messageHeaderSize() const
Parser & operator=(const Parser &)=default
bool needsMoreData() const
SBuf mimeHeaderBlock_
buffer holding the mime headers (if any)
::Parser::Tokenizer Tokenizer
static const SBuf Http1magic
RFC 7230 section 2.6 - 7 magic octets.
size_type length() const
Returns the number of bytes stored in SBuf.
MemBlob::size_type size_type
void ParseBws(Parser::Tokenizer &)
@ HTTP_PARSE_CHUNK_EXT
HTTP/1.1 chunked encoding chunk-ext.
@ HTTP_PARSE_CHUNK_SZ
HTTP/1.1 chunked encoding chunk-size.
@ HTTP_PARSE_FIRST
HTTP/1 message first-line.
@ HTTP_PARSE_DONE
parsed a message header, or reached a terminal syntax error
@ HTTP_PARSE_MIME
HTTP/1 mime-header block.
@ HTTP_PARSE_NONE
initialized, but nothing usefully parsed yet
@ HTTP_PARSE_CHUNK
HTTP/1.1 chunked encoding chunk-data.
void ParseStrictBws(Parser::Tokenizer &)
int ErrorLevel()
the right debugs() level for logging HTTP violation messages
Generic protocol-agnostic parsing tools.