|
Squid Web Cache master
|
#include <ContentLengthInterpreter.h>
Public Member Functions | |
| ContentLengthInterpreter () | |
| bool | checkField (const String &field) |
| void | applyStatusCodeRules (const StatusCode code) |
| prohibits Content-Length in 1xx and 204 responses | |
| void | applyTrailerRules () |
| prohibits Content-Length in GET/HEAD requests | |
| const char * | prohibitedAndIgnored () const |
Public Attributes | |
| int64_t | value |
| const char * | headerWideProblem |
| worst header-wide problem found (or nil) | |
| const int | debugLevel |
| debugging level for certain warnings | |
| bool | sawBad |
| whether a malformed Content-Length value was present | |
| bool | needsSanitizing |
| bool | sawGood |
Protected Member Functions | |
| const char * | findDigits (const char *prefix, const char *valueEnd) const |
| bool | goodSuffix (const char *suffix, const char *const end) const |
| checks whether all characters after the Content-Length are allowed | |
| bool | checkValue (const char *start, const int size) |
| bool | checkList (const String &list) |
| handles Content-Length: a, b, c | |
Private Attributes | |
| const char * | prohibitedAndIgnored_ |
| whether and why Content-Length is prohibited | |
Finds the intended Content-Length value while parsing message-header fields. Deals with complications such as value lists and/or repeated fields.
Definition at line 21 of file ContentLengthInterpreter.h.
| Http::ContentLengthInterpreter::ContentLengthInterpreter | ( | ) |
Definition at line 22 of file ContentLengthInterpreter.cc.
|
inline |
Definition at line 31 of file ContentLengthInterpreter.h.
References prohibitedAndIgnored_, Http::ProhibitsContentLength(), and Http::scNoContent.
Referenced by HttpReply::configureContentLengthInterpreter().
|
inline |
prohibits Content-Length in trailer
Definition at line 42 of file ContentLengthInterpreter.h.
References prohibitedAndIgnored_.
Referenced by Adaptation::Icap::TrailerParser::parse().
| bool Http::ContentLengthInterpreter::checkField | ( | const String & | field | ) |
updates history based on the given message-header field
Definition at line 153 of file ContentLengthInterpreter.cc.
References String::pos(), String::rawBuf(), and String::size().
Referenced by HttpHeader::parse().
|
protected |
Definition at line 129 of file ContentLengthInterpreter.cc.
References Config, debugs, Must, SquidConfig::onoff, String::rawBuf(), SquidConfig::relaxed_header_parser, String::size(), and strListGetItem().
|
protected |
handles a single-token Content-Length value rawValue null-termination requirements are those of httpHeaderParseOffset()
Definition at line 71 of file ContentLengthInterpreter.cc.
References Config, DBG_IMPORTANT, debugs, httpHeaderParseOffset(), Must, SquidConfig::onoff, and SquidConfig::relaxed_header_parser.
|
protected |
checks whether all characters before the Content-Length number are allowed
Definition at line 36 of file ContentLengthInterpreter.cc.
References CharacterSet::DIGIT, whitespace, and Http::One::Parser::WhitespaceCharacters().
|
protected |
Definition at line 53 of file ContentLengthInterpreter.cc.
References Http::One::Parser::DelimiterCharacters().
|
inline |
Definition at line 47 of file ContentLengthInterpreter.h.
References prohibitedAndIgnored_.
Referenced by HttpHeader::parse().
| const int Http::ContentLengthInterpreter::debugLevel |
Definition at line 55 of file ContentLengthInterpreter.h.
| const char* Http::ContentLengthInterpreter::headerWideProblem |
Definition at line 54 of file ContentLengthInterpreter.h.
Referenced by HttpHeader::parse().
| bool Http::ContentLengthInterpreter::needsSanitizing |
whether all remembered fields should be removed removed fields ought to be replaced with the intended value (if known) irrelevant if sawBad is set
Definition at line 63 of file ContentLengthInterpreter.h.
Referenced by HttpHeader::parse().
|
private |
Definition at line 77 of file ContentLengthInterpreter.h.
Referenced by applyStatusCodeRules(), applyTrailerRules(), and prohibitedAndIgnored().
| bool Http::ContentLengthInterpreter::sawBad |
Definition at line 58 of file ContentLengthInterpreter.h.
Referenced by HttpHeader::parse().
| bool Http::ContentLengthInterpreter::sawGood |
whether a valid field value was present, possibly among problematic ones irrelevant if sawBad is set
Definition at line 67 of file ContentLengthInterpreter.h.
Referenced by HttpHeader::parse().
| int64_t Http::ContentLengthInterpreter::value |
intended Content-Length value if sawGood is set and sawBad is not set meaningless otherwise
Definition at line 51 of file ContentLengthInterpreter.h.
Referenced by HttpHeader::parse().