#include "squid.h"
#include "compat/strtoll.h"
#include "HttpHdrContRange.h"
#include "HttpHeader.h"
#include "HttpHeaderTools.h"
#include "MemBuf.h"
#include "StrList.h"
#include <cerrno>

Go to the source code of this file.
Functions | |
static void | httpHeaderPutStrvf (HttpHeader *hdr, Http::HdrType id, const char *fmt, va_list vargs) |
void | httpHeaderPutStrf (HttpHeader *hdr, Http::HdrType id, const char *fmt,...) |
void | httpHeaderAddContRange (HttpHeader *hdr, HttpHdrRangeSpec spec, int64_t ent_len) |
bool | httpHeaderHasConnDir (const HttpHeader *hdr, const SBuf &directive) |
int | httpHeaderParseInt (const char *start, int *value) |
bool | httpHeaderParseOffset (const char *start, int64_t *value, char **endPtr) |
Function Documentation
◆ httpHeaderAddContRange()
void httpHeaderAddContRange | ( | HttpHeader * | hdr, |
HttpHdrRangeSpec | spec, | ||
int64_t | ent_len | ||
) |
wrapper arrounf PutContRange
Definition at line 47 of file HttpHeaderTools.cc.
References assert, httpHdrContRangeCreate(), httpHdrContRangeSet(), and HttpHeader::putContRange().
Referenced by Ftp::Gateway::appendSuccessHeader(), Http::Stream::buildRangeHeader(), and clientPackRangeHdr().
◆ 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 62 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 84 of file HttpHeaderTools.cc.
References assert, debugs, and xisdigit.
Referenced by HttpHeaderEntry::getInt(), HttpHdrSc::parse(), and HttpHdrCc::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 98 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 25 of file HttpHeaderTools.cc.
References httpHeaderPutStrvf().
Referenced by ErrorState::BuildHttpReply(), Http::Stream::buildRangeHeader(), clientReplyContext::buildReplyHeader(), HttpStateData::httpBuildRequestHeader(), httpFixupAuthentication(), and HttpHeader::putAuth().
◆ httpHeaderPutStrvf()
|
static |
Definition at line 36 of file HttpHeaderTools.cc.
References MemBuf::buf, MemBuf::clean(), MemBuf::init(), HttpHeader::putStr(), and MemBuf::vappendf().
Referenced by httpHeaderPutStrf().
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products