Http::ContentLengthInterpreter Class Reference

#include <ContentLengthInterpreter.h>

Collaboration diagram for Http::ContentLengthInterpreter:

Public Member Functions

 ContentLengthInterpreter (const int aDebugLevel)
 
bool checkField (const String &field)
 

Public Attributes

int64_t value
 
const char * headerWideProblem
 worst header-wide problem found (or nil) More...
 
const int debugLevel
 debugging level for certain warnings More...
 
bool sawBad
 whether a malformed Content-Length value was present More...
 
bool needsSanitizing
 
bool sawGood
 

Protected Member Functions

bool goodSuffix (const char *suffix, const char *const end) const
 checks whether all characters after the Content-Length are allowed More...
 
bool checkValue (const char *start, const int size)
 
bool checkList (const String &list)
 handles Content-Length: a, b, c More...
 

Detailed Description

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 19 of file ContentLengthInterpreter.h.

Constructor & Destructor Documentation

Http::ContentLengthInterpreter::ContentLengthInterpreter ( const int  aDebugLevel)
explicit

Definition at line 21 of file ContentLengthInterpreter.cc.

Member Function Documentation

bool Http::ContentLengthInterpreter::checkField ( const String field)

updates history based on the given message-header field

Returns
true iff the field should be added/remembered for future use

Definition at line 124 of file ContentLengthInterpreter.cc.

References String::pos(), String::rawBuf(), and String::size().

Referenced by HttpHeader::parse().

bool Http::ContentLengthInterpreter::checkList ( const String list)
protected
bool Http::ContentLengthInterpreter::checkValue ( const char *  rawValue,
const int  valueSize 
)
protected

handles a single-token Content-Length value rawValue null-termination requirements are those of httpHeaderParseOffset()

Definition at line 51 of file ContentLengthInterpreter.cc.

References Config, DBG_IMPORTANT, debugs, httpHeaderParseOffset(), Must, SquidConfig::onoff, and SquidConfig::relaxed_header_parser.

bool Http::ContentLengthInterpreter::goodSuffix ( const char *  suffix,
const char *const  end 
) const
protected

Member Data Documentation

const int Http::ContentLengthInterpreter::debugLevel

Definition at line 34 of file ContentLengthInterpreter.h.

const char* Http::ContentLengthInterpreter::headerWideProblem

Definition at line 33 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 42 of file ContentLengthInterpreter.h.

Referenced by HttpHeader::parse().

bool Http::ContentLengthInterpreter::sawBad

Definition at line 37 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 46 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 30 of file ContentLengthInterpreter.h.

Referenced by HttpHeader::parse().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors