#include "acl/forward.h"#include "format/Format.h"#include "HttpHeader.h"#include "sbuf/forward.h"#include <functional>#include <list>#include <map>#include <string>

Go to the source code of this file.
Classes | |
| class | headerMangler |
| class | HeaderManglers |
| A collection of headerMangler objects for a given message kind. More... | |
| class | HeaderManglers::NoCaseLessThan |
| class | HeaderWithAcl |
Typedefs | |
| typedef std::list< HeaderWithAcl > | HeaderWithAclList |
Enumerations | |
| enum | req_or_rep_t { ROR_REQUEST , ROR_REPLY } |
Functions | |
| bool | httpHeaderParseOffset (const char *start, int64_t *offPtr, char **endPtr=nullptr) |
| bool | httpHeaderHasConnDir (const HttpHeader *hdr, const SBuf &directive) |
| int | httpHeaderParseInt (const char *start, int *val) |
| void | httpHeaderPutStrf (HttpHeader *hdr, Http::HdrType id, const char *fmt,...) PRINTF_FORMAT_ARG3 |
| const char * | getStringPrefix (const char *str, size_t len) |
| void | httpHdrMangleList (HttpHeader *, HttpRequest *, const AccessLogEntryPointer &al, req_or_rep_t req_or_rep) |
Typedef Documentation
◆ HeaderWithAclList
| typedef std::list<HeaderWithAcl> HeaderWithAclList |
Definition at line 30 of file HttpHeaderTools.h.
Enumeration Type Documentation
◆ req_or_rep_t
| enum req_or_rep_t |
| Enumerator | |
|---|---|
| ROR_REQUEST | |
| ROR_REPLY | |
Definition at line 33 of file HttpHeaderTools.h.
Function Documentation
◆ getStringPrefix()
| const char * getStringPrefix | ( | const char * | str, |
| size_t | sz | ||
| ) |
handy to printf prefixes of potentially very long buffers
Definition at line 110 of file HttpHeaderTools.cc.
References LOCAL_ARRAY, SHORT_PREFIX_SIZE, and xstrncpy().
Referenced by HttpHeaderEntry::parse(), and HttpHeader::parse().
◆ httpHdrMangleList()
| void httpHdrMangleList | ( | HttpHeader * | l, |
| HttpRequest * | request, | ||
| const AccessLogEntryPointer & | al, | ||
| req_or_rep_t | req_or_rep | ||
| ) |
Mangles headers for a list of headers.
Definition at line 336 of file HttpHeaderTools.cc.
References Config, HttpHeader::delAt(), HttpHeader::getEntry(), httpHdrAdd(), httpHdrMangle(), HttpHeaderInitPos, HttpHeader::refreshMask(), SquidConfig::reply_header_access, SquidConfig::reply_header_add, SquidConfig::request_header_access, SquidConfig::request_header_add, ROR_REPLY, and ROR_REQUEST.
Referenced by clientReplyContext::buildReplyHeader(), HttpStateData::httpBuildRequestHeader(), and Http::One::Server::writeControlMsgAndCall().
◆ httpHeaderHasConnDir()
| bool httpHeaderHasConnDir | ( | const HttpHeader * | hdr, |
| const SBuf & | directive | ||
| ) |
- Returns
- true if a given directive is found in the Connection header field-value.
- Note
- if no Connection header exists we may check the Proxy-Connection header
Definition at line 91 of file HttpHeaderTools.cc.
References Http::CONNECTION, HttpHeader::getList(), Http::PROXY_CONNECTION, and strListIsMember().
Referenced by Adaptation::Icap::ModXact::parseIcapHead(), Adaptation::Icap::OptXact::parseResponse(), Http::Message::persistent(), and HttpStateData::statusIfComplete().
◆ httpHeaderParseInt()
parses an int field, complains if something went wrong, returns true on success
Definition at line 123 of file HttpHeaderTools.cc.
References assert, debugs, and xisdigit.
Referenced by HttpHeaderEntry::getInt(), HttpHdrCc::parse(), and HttpHdrSc::parse().
◆ httpHeaderParseOffset()
| bool httpHeaderParseOffset | ( | const char * | start, |
| int64_t * | offPtr, | ||
| char ** | endPtr = nullptr |
||
| ) |
A strtoll(10) wrapper that checks for strtoll() failures and other problems. XXX: This function is not fully compatible with some HTTP syntax rules. Just like strtoll(), allows whitespace prefix, a sign, and any suffix. Requires at least one digit to be present. Sets "off" and "end" arguments if and only if no problems were found.
- Returns
- true if and only if no problems were found.
Definition at line 137 of file HttpHeaderTools.cc.
References debugs, and strtoll().
Referenced by Http::ContentLengthInterpreter::checkValue(), HttpHeaderEntry::getInt64(), httpHdrContRangeParseInit(), httpHdrRangeRespSpecParseInit(), and HttpHdrRangeSpec::parseInit().
◆ httpHeaderPutStrf()
| void httpHeaderPutStrf | ( | HttpHeader * | hdr, |
| Http::HdrType | id, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 54 of file HttpHeaderTools.cc.
References httpHeaderPutStrvf().
Referenced by ErrorState::BuildHttpReply(), Http::Stream::buildRangeHeader(), clientReplyContext::buildReplyHeader(), HttpStateData::httpBuildRequestHeader(), httpFixupAuthentication(), and HttpHeader::putAuth().
