]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/http/ContentLengthInterpreter.h
128c34d885f85450dd2cfec2e2672ca65fddc1dd
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_SRC_HTTP_CONTENTLENGTH_INTERPRETER_H
10 #define SQUID_SRC_HTTP_CONTENTLENGTH_INTERPRETER_H
17 /// Finds the intended Content-Length value while parsing message-header fields.
18 /// Deals with complications such as value lists and/or repeated fields.
19 class ContentLengthInterpreter
22 explicit ContentLengthInterpreter(const int aDebugLevel
);
24 /// updates history based on the given message-header field
25 /// \return true iff the field should be added/remembered for future use
26 bool checkField(const String
&field
);
28 /// intended Content-Length value if sawGood is set and sawBad is not set
29 /// meaningless otherwise
32 /* for debugging (declared here to minimize padding) */
33 const char *headerWideProblem
; ///< worst header-wide problem found (or nil)
34 const int debugLevel
; ///< debugging level for certain warnings
36 /// whether a malformed Content-Length value was present
39 /// whether all remembered fields should be removed
40 /// removed fields ought to be replaced with the intended value (if known)
41 /// irrelevant if sawBad is set
44 /// whether a valid field value was present, possibly among problematic ones
45 /// irrelevant if sawBad is set
49 bool goodSuffix(const char *suffix
, const char * const end
) const;
50 bool checkValue(const char *start
, const int size
);
51 bool checkList(const String
&list
);
56 #endif /* SQUID_SRC_HTTP_CONTENTLENGTH_INTERPRETER_H */