HttpHeader.cc File Reference
#include "squid.h"
#include "base/Assure.h"
#include "base/CharacterSet.h"
#include "base/EnumIterator.h"
#include "base/Raw.h"
#include "base64.h"
#include "globals.h"
#include "http/ContentLengthInterpreter.h"
#include "HttpHdrCc.h"
#include "HttpHdrContRange.h"
#include "HttpHdrScTarget.h"
#include "HttpHeader.h"
#include "HttpHeaderFieldStat.h"
#include "HttpHeaderStat.h"
#include "HttpHeaderTools.h"
#include "MemBuf.h"
#include "mgr/Registration.h"
#include "mime_header.h"
#include "sbuf/Stream.h"
#include "sbuf/StringConvert.h"
#include "SquidConfig.h"
#include "StatHist.h"
#include "Store.h"
#include "StrList.h"
#include "time/gadgets.h"
#include "TimeOrTag.h"
#include "util.h"
#include <algorithm>
#include <array>
Include dependency graph for HttpHeader.cc:

Go to the source code of this file.

Macros

#define SHORT_PREFIX_SIZE   512
 

Functions

std::vector< HttpHeaderFieldStatheaderStatsTable (Http::HdrType::enumEnd_)
 
static void httpHeaderNoteParsedEntry (Http::HdrType id, String const &value, bool error)
 
static void httpHeaderStatDump (const HttpHeaderStat *hs, StoreEntry *e)
 
static void httpHeaderStoreReport (StoreEntry *e)
 
static void httpHeaderRegisterWithCacheManager (void)
 
static void httpHeaderMaskInit (HttpHeaderMask *mask, int value)
 
static const char * getStringPrefix (const char *str, size_t sz)
 
void httpHeaderInitModule (void)
 
int httpHeaderParseQuotedString (const char *start, const int len, String *val)
 
SBuf httpHeaderQuoteString (const char *raw)
 quotes string using RFC 7230 quoted-string rules More...
 
static void httpHeaderFieldStatDumper (StoreEntry *sentry, int, double val, double, int count)
 
static void httpHeaderFldsPerHdrDumper (StoreEntry *sentry, int idx, double val, double, int count)
 

Variables

static HttpHeaderMask RequestHeadersMask
 
static HttpHeaderMask ReplyHeadersMask
 
static std::array< HttpHeaderStat, hoEndHttpHeaderStats
 
static int HeaderEntryParsedCount = 0
 
const HttpHeaderStatdump_stat = nullptr
 

Macro Definition Documentation

◆ SHORT_PREFIX_SIZE

#define SHORT_PREFIX_SIZE   512

Function Documentation

◆ getStringPrefix()

static const char* getStringPrefix ( const char *  str,
size_t  sz 
)
static

handy to printf prefixes of potentially very long buffers

Definition at line 129 of file HttpHeader.cc.

References LOCAL_ARRAY, SHORT_PREFIX_SIZE, and xstrncpy().

Referenced by HttpHeaderEntry::parse(), and HttpHeader::parse().

◆ headerStatsTable()

◆ httpHeaderFieldStatDumper()

◆ httpHeaderFldsPerHdrDumper()

static void httpHeaderFldsPerHdrDumper ( StoreEntry sentry,
int  idx,
double  val,
double  ,
int  count 
)
static

Definition at line 1714 of file HttpHeader.cc.

References HttpHeaderStat::destroyedCount, dump_stat, storeAppendPrintf(), and xpercent().

Referenced by httpHeaderStatDump().

◆ httpHeaderInitModule()

◆ httpHeaderMaskInit()

static void httpHeaderMaskInit ( HttpHeaderMask mask,
int  value 
)
static

◆ httpHeaderNoteParsedEntry()

◆ httpHeaderParseQuotedString()

int httpHeaderParseQuotedString ( const char *  start,
const int  len,
String val 
)

Parses a quoted-string field (RFC 2616 section 2.2), complains if something went wrong, returns non-zero on success. Un-escapes quoted-pair characters found within the string. start should point at the first double-quote.

Definition at line 167 of file HttpHeader.cc.

References String::append(), String::assign(), String::clean(), debugs, and String::termedBuf().

Referenced by HttpHdrSc::parse(), HttpHdrCc::parse(), Ftp::PrintReply(), and Http::SlowlyParseQuotedString().

◆ httpHeaderQuoteString()

SBuf httpHeaderQuoteString ( const char *  raw)

Definition at line 237 of file HttpHeader.cc.

References SBuf::append(), and assert.

Referenced by Ftp::Relay::createHttpReply().

◆ httpHeaderRegisterWithCacheManager()

static void httpHeaderRegisterWithCacheManager ( void  )
static

Definition at line 114 of file HttpHeader.cc.

References httpHeaderStoreReport(), and Mgr::RegisterAction().

Referenced by httpHeaderInitModule().

◆ httpHeaderStatDump()

◆ httpHeaderStoreReport()

void httpHeaderStoreReport ( StoreEntry e)
static

store report about current header usage and other stats

Definition at line 1754 of file HttpHeader.cc.

References assert, HeaderEntryParsedCount, Http::HeaderLookupTable, headerStatsTable(), hoReply, hoRequest, httpHeaderStatDump(), HttpHeaderStats, storeAppendPrintf(), and xpercent().

Referenced by httpHeaderRegisterWithCacheManager().

Variable Documentation

◆ dump_stat

◆ HeaderEntryParsedCount

int HeaderEntryParsedCount = 0
static

Definition at line 94 of file HttpHeader.cc.

Referenced by httpHeaderStoreReport(), and HttpHeaderEntry::parse().

◆ HttpHeaderStats

std::array<HttpHeaderStat, hoEnd> HttpHeaderStats
static
Initial value:
= {{
HttpHeaderStat( "all", nullptr),
HttpHeaderStat( "HTCP reply", &ReplyHeadersMask),
, HttpHeaderStat( "error detail templates", nullptr)
}
}

Definition at line 80 of file HttpHeader.cc.

Referenced by HttpHeader::clean(), HttpHeader::getCc(), HttpHeader::getSc(), httpHeaderInitModule(), httpHeaderStoreReport(), and HttpHeader::parse().

◆ ReplyHeadersMask

HttpHeaderMask ReplyHeadersMask
static

Definition at line 76 of file HttpHeader.cc.

Referenced by httpHeaderInitModule().

◆ RequestHeadersMask

HttpHeaderMask RequestHeadersMask
static

Definition at line 73 of file HttpHeader.cc.

Referenced by httpHeaderInitModule().

HTTP per header statistics.
static HttpHeaderMask ReplyHeadersMask
Definition: HttpHeader.cc:76
static HttpHeaderMask RequestHeadersMask
Definition: HttpHeader.cc:73

 

Introduction

Documentation

Support

Miscellaneous