74static const char *
const crlf =
"\r\n";
84 debugs(11,5,
"HttpStateData " <<
this <<
" created");
141 debugs(11, 5,
"httpStateFree: FD " << params.
fd <<
", httpState=" << params.
data);
143 mustStop(
"HttpStateData::httpStateConnClosed");
156 mustStop(
"HttpStateData::httpTimeout");
227 if (!remove && !forbidden)
302#if USE_HTTP_VIOLATIONS
311#define REFRESH_OVERRIDE(flag) \
312 ((R = (R ? R : refreshLimits(entry->mem_obj->storeId()))) , \
313 (R && R->flags.flag))
315#define REFRESH_OVERRIDE(flag) 0
344 "client request Cache-Control:no-store");
354 "server reply Cache-Control:no-cache has parameters");
364 "server reply Cache-Control:no-store");
378 "server reply Cache-Control:private");
387 "authenticated and server reply missing Cache-Control");
391 "authenticated and ignoring Cache-Control");
393 bool mayStore =
false;
396 debugs(22, 3,
"Authenticated but server reply Cache-Control:public");
401 debugs(22, 3,
"Authenticated but server reply Cache-Control:must-revalidate");
404#if USE_HTTP_VIOLATIONS
410 debugs(22, 3,
"Authenticated but server reply Cache-Control:no-cache (equivalent to must-revalidate)");
416 debugs(22, 3,
"Authenticated but server reply Cache-Control:s-maxage");
432 if (!strncasecmp(v,
"multipart/x-mixed-replace", 25))
436 static const char *shareableError =
"shareable error status code";
437 static const char *nonShareableError =
"non-shareable error status code";
439 const char *statusReason = nonShareableError;
501 statusReason = shareableError;
505#if USE_HTTP_VIOLATIONS
510 decision.
make(statusAnswer, statusReason);
556 static const SBuf asterisk(
"*");
557 const char *pos =
nullptr;
558 const char *item =
nullptr;
562 SBuf name(item, ilen);
563 if (name == asterisk) {
598#if X_ACCELERATOR_VARY
662 bool parsedOk =
hp->parse(
inBuf);
670 if (
hp->needsMoreData()) {
675 debugs(33, 5,
"Incomplete response, waiting for end of response headers");
683 debugs(11, 3,
"Non-HTTP-compliant header:\n---------\n" <<
inBuf <<
"\n----------");
698 debugs(11, 2,
"HTTP Server RESPONSE:\n---------\n" <<
699 hp->messageProtocol() <<
" " <<
hp->messageStatus() <<
" " <<
hp->reasonPhrase() <<
"\n" <<
710 newrep->sline.set(
hp->messageProtocol(),
hp->messageStatus() );
713 if (!newrep->parseHeader(*
hp)) {
715 debugs(11, 2,
"error parsing response headers mime block");
729 if (newrep->sline.version.protocol ==
AnyP::PROTO_HTTP && newrep->header.chunked()) {
766 return drop1xx(
"we have sent it already");
769 return drop1xx(
"the client does not support it");
771#if USE_HTTP_VIOLATIONS
779 return drop1xx(
"http_reply_access blocked it");
788 debugs(11, 2,
"forwarding 1xx to client");
808 debugs(11, 2,
"bad 101 because " << reason);
812 mustStop(
"prohibited HTTP/101 response");
816 debugs(11, 2,
"ignoring 1xx because " << reason);
826 return "Squid offered no Upgrade at all, but server switched to a tunnel";
831 return "server did not send an Upgrade header field";
834 return "server did not send 'Connection: upgrade'";
837 const char *pos =
nullptr;
838 const char *accepted =
nullptr;
840 while (
strListGetItem(&acceptedProtos,
',', &accepted, &acceptedLen, &pos)) {
841 debugs(11, 5,
"server accepted at least" <<
Raw(
nullptr, accepted, acceptedLen));
845 return "server sent an essentially empty Upgrade header field";
871 debugs(11, 2,
"continuing with " <<
payloadSeen <<
" bytes in buffer after 1xx");
947 debugs(11, 3,
"HTTP CODE: " << statusCode);
950 oldEntry->lock(
"HttpStateData::haveParsedReplyHeaders");
952 oldEntry->unlock(
"HttpStateData::haveParsedReplyHeaders");
958 bool varyFailure =
false;
978 static const SBuf asterisk(
"*");
979 if (vary == asterisk)
1022 debugs(11, 3,
"decided: " << decision);
1042 if (ccNoCacheNoParams || ccPrivate)
1044 else if (ccMustRevalidate || ccSMaxAge)
1047#if USE_HTTP_VIOLATIONS
1068 static SBuf close(
"close", 5);
1138 debugs(11, 5,
"persistentConnStatus: clen=" << clen);
1149 if (payloadSeen < vrep->content_length)
1176 debugs(11, 3,
"http socket closing");
1196 if (!moreDataPermission) {
1197 abortTransaction(
"ready to read required data, but the read buffer is full and cannot be drained");
1205 if (readSizeWanted <= 0) {
1232 rd.
size = readSizeWanted;
1253 for (
int clen = rd.
size - 1; clen; ++bin)
1277 mustStop(
"HttpStateData::readReply");
1292 debugs(11, 5,
"done with 1xx handling");
1298 abortTransaction(
"store entry aborted while we were waiting for processReply()");
1322 debugs(11, 5,
"wait for 1xx handling");
1351 }
else if (vrep->header.conflictingContentLength()) {
1354 }
else if (vrep->header.unsupportedTe()) {
1380 mustStop(
"HttpStateData::continueAfterParsingHeader");
1416 err->detailError(d);
1436 const char *parsedWhole =
nullptr;
1438 parsedWhole =
"http parsed header-only reply";
1440 parsedWhole =
"http parsed Content-Length body bytes";
1441 else if (clen < 0 &&
eof)
1442 parsedWhole =
"http parsed body ending with expected/required EOF";
1552 bool ispinned =
false;
1563 notePinnedConnectionBecameIdle,
1567 serverConnectionSaved->close();
1600 debugs(11, 3,
"no, peer connection gone");
1606 debugs(11, 3,
"no, saw EOF");
1612 debugs(11, 3,
"no, saw last-chunk");
1617 abortTransaction(
"more response bytes required, but the read buffer is full and cannot be drained");
1622 debugs(11, 5,
"no, still waiting for noteDelayAwareReadChance()");
1627 debugs(11, 3,
"no, already waiting for readReply()");
1663 return std::min<size_t>(configurationPreferences,
SBuf::maxSize);
1671std::optional<size_t>
1678 debugs(11, 3,
"yes, but waiting for adaptation to drain read buffer");
1686 return std::nullopt;
1689 const auto maxReadSize = maxCapacity -
inBuf.
length();
1719#if URL_CHECKSUM_DEBUG
1744 mustStop(
"HttpStateData::wroteLast");
1814 if (hdr_out->
has(header))
1818 if (strcmp(request->
peer_login,
"PASSTHRU") == 0)
1826 strcmp(request->
peer_login,
"PROXYPASS") == 0 &&
1831 if (auth && strncasecmp(auth,
"basic ", 6) == 0) {
1832 hdr_out->
putStr(header, auth);
1844 const char *username =
"-";
1853 blen =
base64_encode_update(&ctx, loginbuf, strlen(username),
reinterpret_cast<const uint8_t*
>(username));
1863 strcmp(request->
peer_login,
"PROXYPASS") == 0)) {
1873 if (strcmp(request->
peer_login,
"PASS") == 0)
1877#if HAVE_AUTH_MODULE_NEGOTIATE && HAVE_KRB5 && HAVE_GSSAPI
1878 if (strncmp(request->
peer_login,
"NEGOTIATE",strlen(
"NEGOTIATE")) == 0) {
1879 char *Token=
nullptr;
1880 char *PrincipalName=
nullptr,*p;
1881 int negotiate_flags = 0;
1883 if ((p=strchr(request->
peer_login,
':')) !=
nullptr ) {
1889 Token = peer_proxy_negotiate_auth(PrincipalName, peer->
host, negotiate_flags);
1917#define BBUF_SZ (MAX_URL+32)
1940 while ((e = hdr_in->
getEntry(&pos)))
1978 static int warnedCount = 0;
1979 if (warnedCount++ < 100) {
2003 if (strFwd.
size() > 0)
2026 result[blen] =
'\0';
2053 hdr_out->
putCc(*cc);
2079 strConnection.
clean();
2106 const char *pos =
nullptr;
2107 const char *offeredStr =
nullptr;
2108 int offeredStrLen = 0;
2109 while (
strListGetItem(&upgradeIn,
',', &offeredStr, &offeredStrLen, &pos)) {
2110 const ProtocolView offeredProto(offeredStr, offeredStrLen);
2111 debugs(11, 5,
"checks all rules applicable to " << offeredProto);
2113 debugs(11, 5,
"checks " << cfgProto <<
" rule(s)");
2116 if (answer.implicit)
2118 if (answer.allowed())
2119 strListAdd(upgradeOut, offeredStr, offeredStrLen);
2125 if (upgradeOut.
size()) {
2161 debugs(11, 5,
"httpBuildRequestHeader: " << e->
name <<
": " << e->
value );
2174 strcmp(request->
peer_login,
"PROXYPASS") == 0 ||
2175 strcmp(request->
peer_login,
"PASSTHRU") == 0)) {
2209 strcmp(request->
peer_login,
"PASSTHRU") == 0 ||
2210 strcmp(request->
peer_login,
"PROXYPASS") == 0)) {
2267 const int64_t hops = e->
getInt64();
2328 debugs(11, 2,
"'" << e->
name <<
"' header cropped by Connection: definition");
2357 debugs(11, 8,
"decideIfWeDoRanges: range specs: " <<
2369 const int offset = mb->
size;
2407 return mb->
size - offset;
2460 else if (
_peer ==
nullptr)
2490 debugs(11, 2,
"HTTP Server REQUEST:\n---------\n" << mb.
buf <<
"\n----------");
2514 buf.
appendf(
"%x\r\n",
static_cast<unsigned int>(rawDataSize));
2518 Must(rawDataSize > 0);
2524 buf.
append(
"0\r\n\r\n", 5);
2541 debugs(11, 3,
"httpStart: aborted");
2542 mustStop(
"HttpStateData::start failed");
2560#if USE_HTTP_VIOLATIONS
2562 debugs(11, 5,
"No brokenPosts list");
2570 debugs(11, 5,
"didn't match brokenPosts");
2580 debugs(11, 3,
"finishingBrokenPost: fixing broken POST");
2596 debugs(11, 5,
"already sent last-chunk");
2637 err->detailError(d);
2657 debugs(11,5,
"aborting transaction for " << reason <<
2675 static const char *ReuseMessages[] = {
2676 "do not cache and do not share",
2677 "cache positively and share",
2678 "cache negatively and share",
2679 "do not cache but share"
2684 return os << ReuseMessages[d.
answer] <<
" because " << d.
reason <<
#define ScheduleCallHere(call)
RefCount< AsyncCallT< Dialer > > asyncCall(int aDebugSection, int aDebugLevel, const char *aName, const Dialer &aDialer)
#define JobCallback(dbgSection, dbgLevel, Dialer, job, method)
Convenience macro to create a Dialer-based job callback.
#define CallJobHere(debugSection, debugLevel, job, Class, method)
#define CallJobHere1(debugSection, debugLevel, job, Class, method, arg1)
ErrorDetail::Pointer MakeNamedErrorDetail(const char *name)
PconnPool * fwdPconnPool
a collection of previously used persistent Squid-to-peer HTTP(S) connections
#define SQUIDSBUFPRINT(s)
int strListGetItem(const String *str, char del, const char **item, int *ilen, const char **pos)
void strListAdd(String &str, const char *item, const size_t itemSize, const char delimiter)
Appends the given item of a given size to a delimiter-separated list in str.
int strListIsMember(const String *list, const SBuf &m, char del)
std::ostream & CurrentException(std::ostream &os)
prints active (i.e., thrown but not yet handled) exception
void error(char *format,...)
#define X_ACCELERATOR_VARY
void base64_encode_init(struct base64_encode_ctx *ctx)
size_t base64_encode_update(struct base64_encode_ctx *ctx, char *dst, size_t length, const uint8_t *src)
size_t base64_encode_final(struct base64_encode_ctx *ctx, char *dst)
#define base64_encode_len(length)
int cbdataReferenceValid(const void *p)
#define cbdataReferenceDone(var)
#define cbdataReference(var)
#define CBDATA_CLASS_INIT(type)
Acl::Answer const & fastCheck()
void changeAcl(const acl_access *)
change the current ACL list
void updateAle(const AccessLogEntry::Pointer &)
void updateReply(const HttpReply::Pointer &)
AccessLogEntry::Pointer al
info for the future access.log, and external ACL
void syncAle(HttpRequest *adaptedRequest, const char *logUri) const override
assigns uninitialized adapted_request and url ALE components
unsigned int major
major version number
ProtocolType protocol
which protocol this version is for
unsigned int minor
minor version number
AnyP::UriScheme const & getScheme() const
SBuf & authority(bool requirePort=false) const
SBuf & originForm() const
The RFC 7230 origin-form URI for currently stored values.
void host(const char *src)
void userInfo(const SBuf &s)
static void Start(const Pointer &job)
void mustStop(const char *aReason)
char const * username() const
size_t getMoreData(MemBuf &buf)
const MemBuf & buf() const
int connection_auth
0 - off, 1 - on, 2 - auto
struct CachePeer::@20 options
struct CachePeer::@18 stats
int front_end_https
0 - off, 1 - on, 2 - auto
Cbc * valid() const
was set and is valid
bool adaptationAccessCheckPending
bool receivedWholeRequestBody
handleRequestBodyProductionEnded called
BodyPipe::Pointer requestBodySource
AsyncCall::Pointer requestSender
virtual HttpRequestPointer originalRequest()
a hack to reach HttpStateData::orignal_request
const HttpReply * virginReply() const
virtual bool getMoreRequestBody(MemBuf &buf)
either fill buf with available [encoded] request body bytes or return false
virtual void handleRequestBodyProducerAborted()=0
bool waitingForDelayAwareReadChance
whether we are waiting for MemObject::delayRead() to call us back
bool startRequestBodyFlow()
HttpReply * setVirginReply(HttpReply *r)
BodyPipe::Pointer virginBodyDestination
void adaptOrFinalizeReply()
size_t calcBufferSpaceToReserve(const size_t space, const size_t wantSpace) const
determine how much space the buffer needs to reserve
void addVirginReplyBody(const char *buf, ssize_t len)
HttpRequestPointer request
void markParsedVirginReplyAsWhole(const char *reasonWeAreSure)
MemBuf * responseBodyBuffer
virtual void sentRequestBody(const CommIoCbParams &io)=0
virtual void doneSendingRequestBody()=0
virtual void haveParsedReplyHeaders()
called when we have final (possibly adapted) reply headers; kids extend
int xerrno
The last errno to occur. non-zero if flag is Comm::COMM_ERROR.
int fd
FD which the call was about. Set by the async call creator.
Comm::Flag flag
comm layer result status.
Comm::ConnectionPointer conn
CachePeer * getPeer() const
parameters for the async notePinnedConnectionBecameIdle() call
noteTakeServerConnectionControl() callback parameter
virtual void noteTakeServerConnectionControl(ServerConnectionContext)
void sendControlMsg(HttpControlMsg) override
called to send the 1xx message and notify the Source
void unregister(Comm::ConnectionPointer &conn)
Comm::ConnectionPointer const & serverConnection() const
void fail(ErrorState *err)
AccessLogEntryPointer al
info for the future access.log entry
Http::StatusCode peer_reply_status
last HTTP status code received
bundles HTTP 1xx reply and the "successfully forwarded" callback
bool hasSMaxAge(int32_t *val=nullptr) const
bool hasMustRevalidate() const
bool hasNoCache(const String **val=nullptr) const
bool hasPrivate(const String **val=nullptr) const
bool hasNoCacheWithoutParameters() const
void onlyIfCached(bool v)
bool hasMaxAge(int32_t *val=nullptr) const
bool hasProxyRevalidate() const
bool hasNoCacheWithParameters() const
bool offsetLimitExceeded(const int64_t limit) const
void noStoreRemote(bool v)
HttpHdrScTarget * getMergedTarget(const char *ourtarget)
bool olderThan(const HttpReply *them) const
bool expectingBody(const HttpRequestMethod &, int64_t &) const override
HttpHdrSc * surrogate_control
int64_t bodySize(const HttpRequestMethod &) const
const SBuf & image() const
CbcPointer< ConnStateData > clientConnectionManager
int64_t getRangeOffsetLimit()
bool multipartRangeRequest() const
bool forcedBodyContinuation
whether we have responded with HTTP 100 or FTP 150 already
String etag
A strong etag of the cached entry. Used for refreshing that entry.
void ignoreRange(const char *reason)
forgets about the cached Range header (for a reason)
Auth::UserRequest::Pointer auth_user_request
bool canHandle1xx() const
whether the client is likely to be able to handle a 1xx reply
AnyP::Uri url
the request URI
const SBuf & effectiveRequestUri() const
RFC 7230 section 5.5 - Effective Request URI.
assists in making and relaying entry caching/sharing decision
const Http::StatusCode statusCode
HTTP status for debugging.
Answers answer
the decision id
ReuseDecision(const StoreEntry *e, const Http::StatusCode code)
const StoreEntry * entry
entry for debugging
Answers make(const Answers ans, const char *why)
stores the corresponding decision
const char * reason
the decision reason
void httpStateConnClosed(const CommCloseCbParams ¶ms)
void handleRequestBodyProducerAborted() override
AsyncCall::Pointer closeHandler
Http1::ResponseParserPointer hp
Parser being used at present to parse the HTTP/ICY server response.
String * upgradeHeaderOut
Upgrade header value sent to the origin server or cache peer.
void start() override
called by AsyncStart; do not call directly
const char * blockSwitchingProtocols(const HttpReply &) const
std::optional< size_t > canBufferMoreReplyBytes() const
static bool decideIfWeDoRanges(HttpRequest *orig_request)
void truncateVirginBody()
ConnectionStatus persistentConnStatus() const
void sendComplete()
successfully wrote the entire request (including body, last-chunk, etc.)
void httpTimeout(const CommTimeoutCbParams ¶ms)
ReuseDecision::Answers reusableReply(ReuseDecision &decision)
void checkDateSkew(HttpReply *)
size_t maybeMakeSpaceAvailable(size_t maxReadSize)
bool doneWithServer() const override
int64_t payloadTruncated
positive when we read more than we wanted
void haveParsedReplyHeaders() override
called when we have final (possibly adapted) reply headers; kids extend
static void httpBuildRequestHeader(HttpRequest *request, StoreEntry *entry, const AccessLogEntryPointer &al, HttpHeader *hdr_out, const CachePeer *peer, const Http::StateFlags &flags)
void abortTransaction(const char *reason)
mb_size_t buildRequestPrefix(MemBuf *mb)
void readReply(const CommIoCbParams &io)
void handle1xx(const HttpReplyPointer &)
ignore or start forwarding the 1xx response (a.k.a., control message)
SBuf inBuf
I/O buffer for receiving server responses.
bool getMoreRequestBody(MemBuf &buf) override
either fill buf with available [encoded] request body bytes or return false
HttpStateData(FwdState *)
void abortAll(const char *reason) override
abnormal transaction termination; reason is for debugging only
void processSurrogateControl(HttpReply *)
ConnectionStatus statusIfComplete() const
void processReplyBody() override
bool decodeAndWriteReplyBody()
bool waitingForCommRead
whether we are waiting for our Comm::Read() handler to be called
size_t calcReadBufferCapacityLimit() const
void markPrematureReplyBodyEofFailure()
called on a premature EOF discovered when reading response body
bool mayReadVirginReplyBody() const override
whether we may receive more virgin response body bytes
bool continueAfterParsingHeader()
void maybeReadVirginBody() override
read response data from the network
int64_t payloadSeen
amount of message payload/body received so far.
@ COMPLETE_PERSISTENT_MSG
@ COMPLETE_NONPERSISTENT_MSG
bool peerSupportsConnectionPinning() const
void closeServer() override
void wroteLast(const CommIoCbParams &io)
called after writing the very last request byte (body, last-chunk, etc)
void processReplyHeader()
void noteDelayAwareReadChance() override
const Comm::ConnectionPointer & dataConnection() const override
void sentRequestBody(const CommIoCbParams &io) override
Comm::ConnectionPointer serverConnection
~HttpStateData() override
void proceedAfter1xx()
restores state and resumes processing after 1xx is ignored or forwarded
bool finishingChunkedRequest()
if needed, write last-chunk to end the request body and return true
void forwardUpgrade(HttpHeader &)
void keepaliveAccounting(HttpReply *)
Http1::TeChunkedParser * httpChunkDecoder
bool finishingBrokenPost()
if broken posts are enabled for the request, try to fix and return true
void drop1xx(const char *reason)
void doneSendingRequestBody() override
void forApplicable(const ProtocolView &, const Visitor &) const
@ srcHttp
http_port or HTTP server
@ srcHttps
https_port or bumped http_port tunnel; HTTPS server
BodyPipe::Pointer body_pipe
optional pipeline to receive message body
HttpHdrCc * cache_control
AnyP::ProtocolVersion http_ver
const SBuf & remaining() const
the remaining unprocessed section of buffer
bool parse(const SBuf &) override
void setPayloadBuffer(MemBuf *parsedContent)
set the buffer to be used to store decoded chunk data
bool sentLastChunk
do not try to write last-chunk again
bool peering
Whether the next TCP hop is a cache_peer, including originserver.
bool chunked_request
writing a chunked request
bool serverSwitchedProtocols
bool keepalive
whether the Squid-sent request offers to keep the connection persistent
bool toOriginPeer() const
Whether the next TCP/HTTP hop is an originserver cache_peer.
bool chunked
reading a chunked response; TODO: rename
bool handling1xx
Whether we are processing an HTTP 1xx control message.
unsigned int front_end_https
send "Front-End-Https: On" header (off/on/auto=2)
void set(const AnyP::ProtocolVersion &newVersion, Http::StatusCode newStatus, const char *newReason=nullptr)
Http::StatusCode status() const
retrieve the status code for this status line
char * toStr(char *buf, const unsigned int blen, int force=AF_UNSPEC) const
void append(const char *c, int sz) override
void init(mb_size_t szInit, mb_size_t szMax)
char * content()
start of the added data
mb_size_t contentSize() const
available data size
bool hasPotentialSpace() const
DelayId mostBytesAllowed() const
HttpRequestPointer request
const HttpReply & freshestReply() const
const char * storeId() const
void appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
Append operation with printf-style arguments.
void push(const Comm::ConnectionPointer &serverConn, const char *domain)
a reference to a protocol name[/version] string; no 0-termination is assumed
static auto Make(Args &&... args)
a representation of a refresh pattern.
bool connectionAuthDisabled
SupportOrVeto cachable
whether the response may be stored in the cache
const char * rawContent() const
SBuf consume(size_type n=npos)
SBuf & chop(size_type pos, size_type n=npos)
size_type length() const
Returns the number of bytes stored in SBuf.
size_type spaceSize() const
SBuf & append(const SBuf &S)
void reserveSpace(size_type minSpace)
void toLower()
converts all characters to lower case;
static const size_type maxSize
Maximum size of a SBuf. By design it MUST be < MAX(size_type)/2. Currently 256Mb.
int cache_miss_revalidate
size_t maxReplyHeaderSize
struct SquidConfig::@77 Timeout
struct SquidConfig::@90 onoff
struct SquidConfig::@91 accessList
struct SquidConfig::@84 Accel
HttpUpgradeProtocolAccess * http_upgrade_request_protocols
http_upgrade_request_protocols
int detect_broken_server_pconns
struct StatCounters::@105::@115 http
struct StatCounters::@105 server
struct StatCounters::@105::@115 all
size_t bytesWanted(Range< size_t > const aRange, bool ignoreDelayPool=false) const
void release(const bool shareable=false)
bool makePublic(const KeyScope keyScope=ksDefault)
const char * getMD5Text() const
void makePrivate(const bool shareable)
void setNoDelay(bool const)
store_status_t store_status
void releaseRequest(const bool shareable=false)
bool canGrowBy(const size_type growthLen) const
whether appending growthLen characters is safe (i.e., unlikely to assert)
char const * rawBuf() const
char const * termedBuf() const
void veto()
makes decision() false regardless of past or future support() calls
void commUnsetConnTimeout(const Comm::ConnectionPointer &conn)
AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *handler, void *data)
void comm_remove_close_handler(int fd, CLCB *handler, void *data)
void commSetConnTimeout(const Comm::ConnectionPointer &conn, time_t timeout, AsyncCall::Pointer &callback)
#define debugs(SECTION, LEVEL, CONTENT)
#define EBIT_SET(flag, bit)
#define EBIT_TEST(flag, bit)
@ RELEASE_REQUEST
prohibits making the key public
@ ENTRY_REVALIDATE_ALWAYS
void fd_bytes(const int fd, const int len, const IoDirection direction)
int neighbors_do_private_keys
#define REFRESH_OVERRIDE(flag)
static const char *const crlf
void httpStart(FwdState *fwd)
static StoreEntry * findPreviouslyCachedEntry(StoreEntry *newEntry)
SBuf httpMakeVaryMark(HttpRequest *request, HttpReply const *reply)
static void httpFixupAuthentication(HttpRequest *request, const HttpHeader *hdr_in, HttpHeader *hdr_out, const CachePeer *const peer, const Http::StateFlags &flags)
static void copyOneHeaderFromClientsideRequestToUpstreamRequest(const HttpHeaderEntry *e, const String strConnection, const HttpRequest *request, HttpHeader *hdr_out, const int we_do_ranges, const Http::StateFlags &)
static void httpMaybeRemovePublic(StoreEntry *, Http::StatusCode)
static void assembleVaryKey(String &vary, SBuf &vstr, const HttpRequest &request)
assemble a variant key (vary-mark) from the given Vary header and HTTP request
SBuf httpMakeVaryMark(HttpRequest *request, HttpReply const *reply)
std::ostream & operator<<(std::ostream &os, const HttpStateData::ReuseDecision &d)
#define MAX_IPSTRLEN
Length of buffer that needs to be allocated to old a null-terminated IP-string.
const char * ProtocolType_str[]
bool MonitorsRead(int fd)
whether the FD socket is being monitored for read
void Read(const Comm::ConnectionPointer &conn, AsyncCall::Pointer &callback)
bool IsConnOpen(const Comm::ConnectionPointer &conn)
void Write(const Comm::ConnectionPointer &conn, const char *buf, int size, AsyncCall::Pointer &callback, FREE *free_func)
Comm::Flag ReadNow(CommIoCbParams ¶ms, SBuf &buf)
bool Is1xx(const int sc)
whether this is an informational 1xx response status code
@ scHeaderTooLarge
Header too large to process.
@ scInvalidHeader
Squid header parsing error.
@ scProxyAuthenticationRequired
@ scRequestedRangeNotSatisfied
@ scNonAuthoritativeInformation
bool IsReforwardableStatus(StatusCode)
whether to send the request to another peer based on the current response status code
AnyP::ProtocolVersion ProtocolVersion()
void neighborsHtcpClear(StoreEntry *e, HttpRequest *req, const HttpRequestMethod &method, htcp_clr_reason reason)
peer_t neighborType(const CachePeer *p, const AnyP::Uri &url)
#define PEER_PROXY_NEGOTIATE_NOKEYTAB
time_t getMaxAge(const char *url)
bool refreshIsCachable(const StoreEntry *entry)
#define rfc1738_escape_part(x)
#define LOCAL_ARRAY(type, name, size)
StoreEntry * storeGetPublicByRequestMethod(HttpRequest *req, const HttpRequestMethod &method, const KeyScope keyScope)
StoreEntry * storeGetPublicByRequest(HttpRequest *req, const KeyScope keyScope)
StoreEntry * storeGetPublic(const char *uri, const HttpRequestMethod &method)
const char * xstrerr(int error)