Inheritance diagram for DetailEntryParser:
Collaboration diagram for DetailEntryParser:

Public Member Functions

 DetailEntryParser ()
void clean ()
void append (const HttpHeader *src)
bool update (HttpHeader const *fresh)
void compact ()
int parse (const char *header_start, size_t len, Http::ContentLengthInterpreter &interpreter)
int parse (const char *buf, size_t buf_len, bool atEnd, size_t &hdr_sz, Http::ContentLengthInterpreter &interpreter)
void packInto (Packable *p, bool mask_sensitive_info=false) const
HttpHeaderEntrygetEntry (HttpHeaderPos *pos) const
HttpHeaderEntryfindEntry (Http::HdrType id) const
int delByName (const SBuf &name)
int delByName (const char *name)
int delById (Http::HdrType id)
void delAt (HttpHeaderPos pos, int &headers_deleted)
void refreshMask ()
void addEntry (HttpHeaderEntry *e)
void insertEntry (HttpHeaderEntry *e)
String getList (Http::HdrType id) const
bool getList (Http::HdrType id, String *s) const
bool conflictingContentLength () const
String getStrOrList (Http::HdrType id) const
String getByName (const SBuf &name) const
String getByName (const char *name) const
String getById (Http::HdrType id) const
bool getByIdIfPresent (Http::HdrType id, String *result) const
bool hasNamed (const SBuf &s, String *value=0) const
bool hasNamed (const char *name, unsigned int namelen, String *value=0) const
SBuf getByNameListMember (const char *name, const char *member, const char separator) const
SBuf getListMember (Http::HdrType id, const char *member, const char separator) const
int has (Http::HdrType id) const
void addVia (const AnyP::ProtocolVersion &ver, const HttpHeader *from=0)
void putInt (Http::HdrType id, int number)
void putInt64 (Http::HdrType id, int64_t number)
void putTime (Http::HdrType id, time_t htime)
void putStr (Http::HdrType id, const char *str)
void putAuth (const char *auth_scheme, const char *realm)
void putCc (const HttpHdrCc *cc)
void putContRange (const HttpHdrContRange *cr)
void putRange (const HttpHdrRange *range)
void putSc (HttpHdrSc *sc)
void putWarning (const int code, const char *const text)
 add a Warning header More...
void putExt (const char *name, const char *value)
int getInt (Http::HdrType id) const
int64_t getInt64 (Http::HdrType id) const
time_t getTime (Http::HdrType id) const
const char * getStr (Http::HdrType id) const
const char * getLastStr (Http::HdrType id) const
HttpHdrCcgetCc () const
HttpHdrRangegetRange () const
HttpHdrScgetSc () const
HttpHdrContRangegetContRange () const
SBuf getAuthToken (Http::HdrType id, const char *auth_scheme) const
ETag getETag (Http::HdrType id) const
TimeOrTag getTimeOrTag (Http::HdrType id) const
int hasListMember (Http::HdrType id, const char *member, const char separator) const
int hasByNameListMember (const char *name, const char *member, const char separator) const
void removeHopByHopEntries ()
bool chunked () const
 whether message uses chunked Transfer-Encoding More...

Public Attributes

std::vector< HttpHeaderEntry *, PoolingAllocator< HttpHeaderEntry * > > entries
HttpHeaderMask mask
http_hdr_owner_type owner
int len

Protected Member Functions

void removeConnectionHeaderEntries ()
bool needUpdate (const HttpHeader *fresh) const
 check whether the fresh header has any new/changed updatable fields More...
bool skipUpdateHeader (const Http::HdrType id) const
void updateWarnings ()

Static Protected Member Functions

static bool Isolate (const char **parse_start, size_t l, const char **blk_start, const char **blk_end)

Detailed Description

Definition at line 178 of file

Constructor & Destructor Documentation

◆ DetailEntryParser()

DetailEntryParser::DetailEntryParser ( )

Definition at line 181 of file

Member Function Documentation

◆ addEntry()

◆ addVia()

◆ append()

void HttpHeader::append ( const HttpHeader src)

◆ chunked()

bool HttpHeader::chunked ( ) const

◆ clean()

◆ compact()

void HttpHeader::compact ( )

◆ conflictingContentLength()

bool HttpHeader::conflictingContentLength ( ) const

◆ delAt()

◆ delById()

◆ delByName() [1/2]

int HttpHeader::delByName ( const SBuf name)

deletes all fields with a given name, if any.

#fields deleted

Definition at line 662 of file

References CBIT_SET, debugs, HttpHeader::delAt(), HttpHeader::getEntry(), HttpHeaderInitPos, httpHeaderMaskInit(), and HttpHeader::mask.

Referenced by Adaptation::Ecap::HeaderRep::removeAny(), and HttpHeader::update().

◆ delByName() [2/2]

int HttpHeader::delByName ( const char *  name)
use SBuf method instead. performance regression: reallocates

Definition at line 100 of file HttpHeader.h.

References HttpHeader::delByName().

Referenced by HttpHeader::delByName().

◆ findEntry()

◆ getAuthToken()

◆ getById()

String HttpHeader::getById ( Http::HdrType  id) const

◆ getByIdIfPresent()

bool HttpHeader::getByIdIfPresent ( Http::HdrType  id,
String result 
) const

returns true iff a [possibly empty] field identified by id is there when returning true, also sets the result parameter (if it is not nil)

Definition at line 911 of file

References Http::BAD_HDR, HttpHeader::getStrOrList(), and HttpHeader::has().

Referenced by Adaptation::Icap::ModXact::expectIcapTrailers(), HttpHeader::getById(), and HttpHeader::hasNamed().

◆ getByName() [1/2]

◆ getByName() [2/2]

String HttpHeader::getByName ( const char *  name) const

Definition at line 879 of file

References HttpHeader::hasNamed().

◆ getByNameListMember()

SBuf HttpHeader::getByNameListMember ( const char *  name,
const char *  member,
const char  separator 
) const

searches for the first matching key=value pair within the name-identified field

the value of the found pair or an empty string

Definition at line 957 of file

References assert, HttpHeader::getByName(), and getListMember().

Referenced by Format::Format::assemble(), Adaptation::Icap::ModXact::gotEncapsulated(), and Adaptation::Icap::OptXact::handleCommRead().

◆ getCc()

◆ getContRange()

◆ getEntry()

◆ getETag()

◆ getInt()

◆ getInt64()

◆ getLastStr()

◆ getList() [1/2]

◆ getList() [2/2]

bool HttpHeader::getList ( Http::HdrType  id,
String s 
) const

◆ getListMember()

SBuf HttpHeader::getListMember ( Http::HdrType  id,
const char *  member,
const char  separator 
) const

searches for the first matching key=value pair within the field

the value of the found pair or an empty string

Definition at line 968 of file

References Http::any_registered_header(), assert, getListMember(), and HttpHeader::getStrOrList().

Referenced by ESIVariableCookie::eval().

◆ getRange()

◆ getSc()

◆ getStr()

◆ getStrOrList()

◆ getTime()

◆ getTimeOrTag()

◆ has()

◆ hasByNameListMember()

int HttpHeader::hasByNameListMember ( const char *  name,
const char *  member,
const char  separator 
) const

Definition at line 1667 of file

References assert, HttpHeader::getByName(), NULL, and strListGetItem().

Referenced by Adaptation::Icap::Options::configure().

◆ hasListMember()

◆ hasNamed() [1/2]

bool HttpHeader::hasNamed ( const SBuf s,
String value = 0 
) const

returns true iff a [possibly empty] named field is there when returning true, also sets the value parameter (if it is not nil)

Definition at line 905 of file

References SBuf::length(), and SBuf::rawContent().

Referenced by HttpHeader::getByName(), Adaptation::Ecap::HeaderRep::hasAny(), ACLHTTPHeaderData::match(), and HttpHeader::needUpdate().

◆ hasNamed() [2/2]

◆ insertEntry()

◆ Isolate()

bool HttpHeader::Isolate ( const char **  parse_start,
size_t  l,
const char **  blk_start,
const char **  blk_end 

either finds the end of headers or returns false If the end was found: *parse_start points to the first character after the header delimiter *blk_start points to the first header character (i.e. old parse_start value) *blk_end points to the first header delimiter character (CR or LF in CR?LF). If block starts where it ends, then there are no fields in the header.

Definition at line 325 of file

References assert, and headersEnd().

Referenced by HttpHeader::parse().

◆ needUpdate()

bool HttpHeader::needUpdate ( const HttpHeader fresh) const

◆ packInto()

◆ parse() [1/2]

◆ parse() [2/2]

int HttpHeader::parse ( const char *  buf,
size_t  buf_len,
bool  atEnd,
size_t hdr_sz,
Http::ContentLengthInterpreter interpreter 

Parses headers stored in a buffer.

1 and sets hdr_sz on success
0 when needs more data
-1 on error

Definition at line 347 of file

References buf, HttpHeader::Isolate(), and HttpHeader::parse().

◆ putAuth()

void HttpHeader::putAuth ( const char *  auth_scheme,
const char *  realm 

◆ putCc()

◆ putContRange()

◆ putExt()

void HttpHeader::putExt ( const char *  name,
const char *  value 

◆ putInt()

void HttpHeader::putInt ( Http::HdrType  id,
int  number 

◆ putInt64()

◆ putRange()

void HttpHeader::putRange ( const HttpHdrRange range)

◆ putSc()

void HttpHeader::putSc ( HttpHdrSc sc)

◆ putStr()

◆ putTime()

◆ putWarning()

void HttpHeader::putWarning ( const int  code,
const char *const  text 

◆ refreshMask()

◆ removeConnectionHeaderEntries()

void HttpHeader::removeConnectionHeaderEntries ( )

◆ removeHopByHopEntries()

◆ skipUpdateHeader()

bool HttpHeader::skipUpdateHeader ( const Http::HdrType  id) const

Definition at line 276 of file

References Http::WARNING.

Referenced by HttpHeader::needUpdate(), and HttpHeader::update().

◆ update()

◆ updateWarnings()

void HttpHeader::updateWarnings ( )

Member Data Documentation

◆ entries

◆ len

int HttpHeader::len

length when packed, not counting terminating null-byte

Definition at line 163 of file HttpHeader.h.

Referenced by HttpHeader::addEntry(), HttpHeader::clean(), HttpHeader::delAt(), HttpHeader::insertEntry(), HttpHeader::operator=(), peerDigestRequest(), and HttpRequest::prefixLen().

◆ mask

◆ owner

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






Web Site Translations