Classes | |
class | ChunkExtensionValueParser |
class | Parser |
class | RequestParser |
class | ResponseParser |
class | Server |
Manages a connection from an HTTP/1 or HTTP/0.9 client. More... | |
class | TeChunkedParser |
Typedefs | |
typedef RefCount< Http::One::Parser > | ParserPointer |
typedef RefCount< Http::One::RequestParser > | RequestParserPointer |
typedef RefCount< Http::One::ResponseParser > | ResponseParserPointer |
Enumerations | |
enum | ParseState { HTTP_PARSE_NONE , HTTP_PARSE_FIRST , HTTP_PARSE_CHUNK_SZ , HTTP_PARSE_CHUNK_EXT , HTTP_PARSE_CHUNK , HTTP_PARSE_MIME , HTTP_PARSE_DONE } |
Functions | |
const SBuf & | CrLf () |
CRLF textual representation. More... | |
void | ParseBws (Parser::Tokenizer &) |
int | ErrorLevel () |
the right debugs() level for logging HTTP violation messages More... | |
SBuf | tokenOrQuotedString (Parser::Tokenizer &tok, const bool http1p0=false) |
Typedef Documentation
◆ ParserPointer
◆ RequestParserPointer
◆ ResponseParserPointer
Enumeration Type Documentation
◆ ParseState
Function Documentation
◆ CrLf()
const SBuf & Http::One::CrLf | ( | ) |
Definition at line 20 of file Parser.cc.
References crlf.
Referenced by Http::One::Parser::cleanMimePrefix(), Http::One::Parser::getHostHeaderField(), Http::One::TeChunkedParser::parseChunkEnd(), Http::One::TeChunkedParser::parseChunkMetadataSuffix(), and Http::One::Parser::skipLineTerminator().
◆ ErrorLevel()
int Http::One::ErrorLevel | ( | ) |
Definition at line 269 of file Parser.cc.
References Config, DBG_IMPORTANT, SquidConfig::onoff, and SquidConfig::relaxed_header_parser.
Referenced by ParseBws(), Http::One::RequestParser::parseHttpVersionField(), Http::One::RequestParser::parseMethodField(), Http::One::RequestParser::parseRequestFirstLine(), Http::One::RequestParser::parseUriField(), Http::One::RequestParser::skipDelimiter(), and Http::One::RequestParser::skipTrailingCrs().
◆ ParseBws()
void Http::One::ParseBws | ( | Parser::Tokenizer & | tok | ) |
skips and, if needed, warns about RFC 7230 BWS ("bad" whitespace)
- Exceptions
-
InsufficientInput when the end of BWS cannot be confirmed
Definition at line 276 of file Parser.cc.
References debugs, ErrorLevel(), and Http::One::Parser::WhitespaceCharacters().
Referenced by Http::One::TeChunkedParser::parseChunkExtensions(), and Http::One::TeChunkedParser::parseOneChunkExtension().
◆ tokenOrQuotedString()
SBuf Http::One::tokenOrQuotedString | ( | Parser::Tokenizer & | tok, |
const bool | http1p0 = false |
||
) |
Extracts either an HTTP/1 token or quoted-string while dealing with possibly incomplete input typical for incremental text parsers. Unescapes escaped characters in HTTP/1.1 quoted strings.
- Parameters
-
http1p0 whether to prohibit -escaped characters in quoted strings
- Exceptions
-
InsufficientInput as appropriate, including on unterminated tokens
- Returns
- extracted token or quoted string (without quotes)
Governed by:
- RFC 1945 section 2.1 " A string of text is parsed as a single word if it is quoted using double-quote marks. @verbatim quoted-string = ( <"> *(qdtext) <"> ) qdtext = <any CHAR except <"> and CTLs, but including LWS> Single-character quoting using the backslash ("\") character is not permitted in HTTP/1.0. "
- RFC 7230 section 3.2.6 " A string of text is parsed as a single value if it is quoted using double-quote marks. quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE qdtext = HTAB / SP /%x21 / %x23-5B / %x5D-7E / obs-text obs-text = %x80-FF "
Definition at line 89 of file Tokenizer.cc.
References parseQuotedStringSuffix(), CharacterSet::TCHAR, and TexcHere.
Referenced by Http::One::ChunkExtensionValueParser::Ignore().