24 headerWideProblem(nullptr),
27 needsSanitizing(false),
29 prohibitedAndIgnored_(nullptr)
40 while (prefix < valueEnd) {
41 const auto ch = *prefix;
60 suffix < end; ++suffix) {
61 if (!delimiters[*suffix])
75 const auto valueEnd = rawValue + valueSize;
77 const auto digits = findDigits(rawValue, valueEnd);
79 debugs(55, debugLevel,
"WARNING: Leading garbage or empty value in" <<
Raw(
"Content-Length", rawValue, valueSize));
84 int64_t latestValue = -1;
85 char *suffix =
nullptr;
93 if (latestValue < 0) {
94 debugs(55, debugLevel,
"WARNING: Negative" <<
Raw(
"Content-Length", rawValue, valueSize));
100 if (!goodSuffix(suffix, valueEnd)) {
101 debugs(55, debugLevel,
"WARNING: Trailing garbage in" <<
Raw(
"Content-Length", rawValue, valueSize));
109 needsSanitizing =
true;
111 const bool conflicting = value != latestValue;
113 headerWideProblem =
"Conflicting";
114 else if (!headerWideProblem)
115 headerWideProblem =
"Duplicate";
134 debugs(55, debugLevel,
"WARNING: List-like" <<
Raw(
"Content-Length", list.
rawBuf(), list.
size()));
139 needsSanitizing =
true;
141 const char *pos =
nullptr;
142 const char *item =
nullptr;;
145 if (!checkValue(item, ilen) && sawBad)
159 return rawValue.
pos(
',') ?
160 checkList(rawValue) :
161 checkValue(rawValue.
rawBuf(), rawValue.
size());
int strListGetItem(const String *str, char del, const char **item, int *ilen, const char **pos)
optimized set of C chars, with quick membership test and merge support
static const CharacterSet DIGIT
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 checkList(const String &list)
handles Content-Length: a, b, c
ContentLengthInterpreter()
bool checkField(const String &field)
bool checkValue(const char *start, const int size)
static const CharacterSet & WhitespaceCharacters()
static const CharacterSet & DelimiterCharacters()
struct SquidConfig::@90 onoff
int relaxed_header_parser
const char * pos(char const *aString) const
char const * rawBuf() const
#define debugs(SECTION, LEVEL, CONTENT)
const CharacterSet whitespace("whitespace"," \r\n")