HttpHeaderTools.cc
Go to the documentation of this file.
43static void httpHeaderPutStrvf(HttpHeader * hdr, Http::HdrType id, const char *fmt, va_list vargs);
44static void httpHdrAdd(HttpHeader *heads, HttpRequest *request, const AccessLogEntryPointer &al, HeaderWithAclList &headersAdd);
214 while (end < (start+len) && *end != '\\' && *end != '\"' && (unsigned char)*end > 0x1F && *end != 0x7F)
238Http::SlowlyParseQuotedString(const char * const description, const char * const start, const size_t length)
286httpHdrMangle(HttpHeaderEntry * e, HttpRequest * request, HeaderManglers *hms, const AccessLogEntryPointer &al)
336httpHdrMangleList(HttpHeader *l, HttpRequest *request, const AccessLogEntryPointer &al, req_or_rep_t req_or_rep)
430 header_mangler_dump_replacement(entry, name, known[id], Http::HeaderLookupTable.lookup(id).name);
498httpHdrAdd(HttpHeader *heads, HttpRequest *request, const AccessLogEntryPointer &al, HeaderWithAclList &headersAdd)
508 for (HeaderWithAclList::const_iterator hwa = headersAdd.begin(); hwa != headersAdd.end(); ++hwa) {
HttpHdrContRange * httpHdrContRangeCreate(void)
Definition: HttpHdrContRange.cc:118
void httpHdrContRangeSet(HttpHdrContRange *cr, HttpHdrRangeSpec spec, int64_t ent_len)
Definition: HttpHdrContRange.cc:220
bool httpHeaderParseOffset(const char *start, int64_t *value, char **endPtr)
Definition: HttpHeaderTools.cc:137
SBuf httpHeaderQuoteString(const char *raw)
quotes string using RFC 7230 quoted-string rules
Definition: HttpHeaderTools.cc:247
static int httpHdrMangle(HttpHeaderEntry *e, HttpRequest *request, HeaderManglers *hms, const AccessLogEntryPointer &al)
Definition: HttpHeaderTools.cc:286
int httpHeaderParseInt(const char *start, int *value)
Definition: HttpHeaderTools.cc:123
static void header_mangler_dump_replacement(StoreEntry *entry, const char *option, const headerMangler &m, const char *name)
Definition: HttpHeaderTools.cc:390
#define SHORT_PREFIX_SIZE
static void header_mangler_clean(headerMangler &m)
Definition: HttpHeaderTools.cc:373
void httpHeaderAddContRange(HttpHeader *hdr, HttpHdrRangeSpec spec, int64_t ent_len)
Definition: HttpHeaderTools.cc:76
void httpHeaderPutStrf(HttpHeader *hdr, Http::HdrType id, const char *fmt,...)
Definition: HttpHeaderTools.cc:54
const char * getStringPrefix(const char *str, size_t sz)
Definition: HttpHeaderTools.cc:110
static void header_mangler_dump_access(StoreEntry *entry, const char *option, const headerMangler &m, const char *name)
Definition: HttpHeaderTools.cc:380
void httpHdrMangleList(HttpHeader *l, HttpRequest *request, const AccessLogEntryPointer &al, req_or_rep_t req_or_rep)
Definition: HttpHeaderTools.cc:336
static void httpHeaderPutStrvf(HttpHeader *hdr, Http::HdrType id, const char *fmt, va_list vargs)
Definition: HttpHeaderTools.cc:65
int httpHeaderParseQuotedString(const char *start, const int len, String *val)
Definition: HttpHeaderTools.cc:168
void httpHeaderMaskInit(HttpHeaderMask *mask, int value)
Definition: HttpHeaderTools.cc:47
static void httpHdrAdd(HttpHeader *heads, HttpRequest *request, const AccessLogEntryPointer &al, HeaderWithAclList &headersAdd)
Definition: HttpHeaderTools.cc:498
bool httpHeaderHasConnDir(const HttpHeader *hdr, const SBuf &directive)
Definition: HttpHeaderTools.cc:91
int strListIsMember(const String *list, const SBuf &m, char del)
Definition: StrList.cc:46
SBuf StringToSBuf(const String &s)
create a new SBuf from a String by copying contents
Definition: StringConvert.h:17
Definition: FilledChecklist.h:32
AccessLogEntry::Pointer al
info for the future access.log, and external ACL
Definition: FilledChecklist.h:101
A collection of headerMangler objects for a given message kind.
Definition: HttpHeaderTools.h:48
void dumpAccess(StoreEntry *entry, const char *optionName) const
report the *_header_access part of the configuration
Definition: HttpHeaderTools.cc:415
const headerMangler * find(const HttpHeaderEntry &e) const
returns a header mangler for field e or nil if none was specified
Definition: HttpHeaderTools.cc:469
void setReplacement(const char *name, const char *replacementValue)
updates mangler for the named header with a replacement value
Definition: HttpHeaderTools.cc:458
headerMangler all
configured if some mangling ACL applies to all header names
Definition: HttpHeaderTools.h:88
headerMangler * track(const char *name)
returns a mangler for the named header (known or custom)
Definition: HttpHeaderTools.cc:441
void dumpReplacement(StoreEntry *entry, const char *optionName) const
report the *_header_replace part of the configuration
Definition: HttpHeaderTools.cc:427
headerMangler known[static_cast< int >(Http::HdrType::enumEnd_)]
one mangler for each known header
Definition: HttpHeaderTools.h:82
Definition: HttpHdrContRange.h:18
Definition: HttpHeaderRange.h:27
Definition: HttpHeader.h:51
Definition: HttpHeader.h:75
HttpHeaderEntry * getEntry(HttpHeaderPos *pos) const
Definition: HttpHeader.cc:584
Definition: HttpRequest.h:49
const HeaderTableRecord & lookup(const char *buf, const std::size_t len) const
look record type up by name (C-string and length)
Definition: RegisteredHeaders.cc:32
Definition: MemBuf.h:24
HeaderManglers * request_header_access
request_header_access and request_header_replace
Definition: SquidConfig.h:461
HeaderManglers * reply_header_access
reply_header_access and reply_header_replace
Definition: SquidConfig.h:463
Definition: Store.h:42
Definition: SquidString.h:26
Definition: EnumIterator.h:222
Definition: HttpHeaderTools.h:40
void dump_acl_access(StoreEntry *entry, const char *name, acl_access *head)
Definition: cache_cf.cc:1516
SBuf SlowlyParseQuotedString(const char *description, const char *start, size_t length)
Definition: HttpHeaderTools.cc:238
bool any_HdrType_enum_value(const Http::HdrType id)
match any known header type, including OTHER and BAD
Definition: RegisteredHeaders.h:205
const HeaderLookupTable_t HeaderLookupTable
Definition: RegisteredHeaders.cc:60
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf
Definition: Stream.h:63