#include <CapturingStoreEntry.h>

Inheritance diagram for CapturingStoreEntry:
Collaboration diagram for CapturingStoreEntry:

Public Member Functions

 CapturingStoreEntry ()
 
void buffer () override
 
void flush () override
 
void append (char const *buf, int len) override
 Appends a c-string to existing packed data. More...
 
bool checkDeferRead (int fd) const
 
const char * getMD5Text () const
 
MemObjectmem ()
 
const MemObjectmem () const
 
const HttpReplyhasFreshestReply () const
 
void write (StoreIOBuffer)
 
bool isEmpty () const
 
bool isAccepting () const
 
size_t bytesWanted (Range< size_t > const aRange, bool ignoreDelayPool=false) const
 
void completeSuccessfully (const char *whyWeAreSureWeStoredTheWholeReply)
 
void completeTruncated (const char *whyWeConsiderTheReplyTruncated)
 
void complete ()
 
store_client_t storeClientType () const
 
const char * getSerialisedMetaData (size_t &length) const
 
void storeErrorResponse (HttpReply *reply)
 Store a prepared error response. MemObject locks the reply object. More...
 
void replaceHttpReply (const HttpReplyPointer &, const bool andStartWriting=true)
 
void startWriting ()
 
bool mayStartSwapOut ()
 whether we may start writing to disk (now or in the future) More...
 
void trimMemory (const bool preserveSwappable)
 
void memOutDecision (const bool willCacheInRam)
 
void swapOutDecision (const MemObject::SwapOut::Decision &decision)
 
void storeWriterDone ()
 called when a store writer ends its work (successfully or not) More...
 
void abort ()
 
bool makePublic (const KeyScope keyScope=ksDefault)
 
void makePrivate (const bool shareable)
 
void clearPrivate ()
 
bool setPublicKey (const KeyScope keyScope=ksDefault)
 
void clearPublicKeyScope ()
 
const cache_keypublicKey () const
 
void setPrivateKey (const bool shareable, const bool permanent)
 
void expireNow ()
 
void releaseRequest (const bool shareable=false)
 
void negativeCache ()
 
bool cacheNegatively ()
 
void invokeHandlers ()
 
void cacheInMemory ()
 start or continue storing in memory cache More...
 
void swapOut ()
 
bool swappingOut () const
 whether we are in the process of writing this entry to disk More...
 
bool swappedOut () const
 whether the entire entry is now on disk (possibly marked for deletion) More...
 
bool swapoutFailed () const
 whether we failed to write this entry to disk More...
 
void swapOutFileClose (int how)
 
const char * url () const
 
bool checkCachable ()
 
int checkNegativeHit () const
 
int locked () const
 
int validToSend () const
 
bool memoryCachable ()
 checkCachable() and can be cached in memory More...
 
void createMemObject ()
 
void createMemObject (const char *storeId, const char *logUri, const HttpRequestMethod &aMethod)
 initialize mem_obj with URIs/method; assert if mem_obj already exists More...
 
void ensureMemObject (const char *storeId, const char *logUri, const HttpRequestMethod &aMethod)
 initialize mem_obj (if needed) and set URIs/method (if missing) More...
 
void dump (int debug_lvl) const
 
void hashDelete ()
 
void hashInsert (const cache_key *)
 
void registerAbortCallback (const AsyncCall::Pointer &)
 notify the StoreEntry writer of a 3rd-party initiated StoreEntry abort More...
 
void reset ()
 
void setMemStatus (mem_status_t)
 
bool timestampsSet ()
 
void unregisterAbortCallback (const char *reason)
 
void destroyMemObject ()
 
int checkTooSmall ()
 
void setNoDelay (bool const)
 
void lastModified (const time_t when)
 
time_t lastModified () const
 
const char * describeTimestamps () const
 
bool modifiedSince (const time_t ims, const int imslen=-1) const
 
bool hasIfMatchEtag (const HttpRequest &request) const
 has ETag matching at least one of the If-Match etags More...
 
bool hasIfNoneMatchEtag (const HttpRequest &request) const
 has ETag matching at least one of the If-None-Match etags More...
 
bool hasEtag (ETag &etag) const
 whether this entry has an ETag; if yes, puts ETag value into parameter More...
 
bool updateOnNotModified (const StoreEntry &e304)
 
Store::Diskdisk () const
 the disk this entry is [being] cached on; asserts for entries w/o a disk More...
 
bool hasDisk (const sdirno dirn=-1, const sfileno filen=-1) const
 
void attachToDisk (const sdirno, const sfileno, const swap_status_t)
 
void detachFromDisk ()
 
bool hasTransients () const
 whether there is a corresponding locked transients table entry More...
 
bool hasMemStore () const
 whether there is a corresponding locked shared memory table entry More...
 
bool hittingRequiresCollapsing () const
 whether this entry can feed collapsed requests and only them More...
 
void setCollapsingRequirement (const bool required)
 allow or forbid collapsed requests feeding More...
 
void * operator new (size_t byteCount)
 
void operator delete (void *address)
 
int64_t objectLen () const
 
int64_t contentLen () const
 
void lock (const char *context)
 
int unlock (const char *context)
 
int locks () const
 returns a local concurrent use counter, for debugging More...
 
void touch ()
 update last reference timestamp and related Store metadata More...
 
void release (const bool shareable=false)
 
void abandon (const char *context)
 
bool mayStartHitting () const
 
void deferProducer (const AsyncCall::Pointer &producer)
 call back producer when more buffer space is available More...
 
void kickProducer ()
 calls back producer registered with deferProducer More...
 
void vappendf (const char *, va_list) override
 
void appendf (const char *fmt,...) PRINTF_FORMAT_ARG2
 Append operation with printf-style arguments. More...
 

Static Public Member Functions

static size_t inUseCount ()
 

Public Attributes

String _appended_text
 
int _buffer_calls
 
int _flush_calls
 
MemObjectmem_obj
 
RemovalPolicyNode repl
 
time_t timestamp
 
time_t lastref
 
time_t expires
 
uint64_t swap_file_sz
 
uint16_t refcount
 
uint16_t flags
 
sfileno swap_filen:25
 unique ID inside a cache_dir for swapped out entries; -1 for others More...
 
sdirno swap_dirn:7
 
mem_status_t mem_status:3
 
ping_status_t ping_status:3
 
store_status_t store_status:3
 
swap_status_t swap_status:3
 
ESIElement::Pointer cachedESITree
 
void * key
 
hash_linknext
 

Protected Types

typedef Store::EntryGuard EntryGuard
 

Protected Member Functions

void storeWritingCheckpoint ()
 
void checkDisk () const
 does nothing except throwing if disk-associated data members are inconsistent More...
 

Private Member Functions

 MEMPROXY_CLASS (CapturingStoreEntry)
 
void doAbandon (const char *context)
 
bool checkTooBig () const
 
void forcePublicKey (const cache_key *newkey)
 
StoreEntryadjustVary ()
 
const cache_keycalcPublicKey (const KeyScope keyScope)
 
void lengthWentBad (const char *reason)
 flags [truncated or too big] entry with ENTRY_BAD_LENGTH and releases it More...
 
bool validLength () const
 
bool hasOneOfEtags (const String &reqETags, const bool allowWeakMatch) const
 whether at least one of the request ETags matches entity ETag More...
 

Private Attributes

time_t lastModified_
 received Last-Modified value or -1; use lastModified() More...
 
unsigned short lock_count
 
bool shareableWhenPrivate
 
AsyncCall::Pointer deferredProducer
 producer callback registered with deferProducer More...
 

Static Private Attributes

static Mem::Allocatorpool = nullptr
 

Detailed Description

Definition at line 16 of file CapturingStoreEntry.h.

Member Typedef Documentation

◆ EntryGuard

typedef Store::EntryGuard StoreEntry::EntryGuard
protectedinherited

Definition at line 306 of file Store.h.

Constructor & Destructor Documentation

◆ CapturingStoreEntry()

CapturingStoreEntry::CapturingStoreEntry ( )
inline

Definition at line 21 of file CapturingStoreEntry.h.

Member Function Documentation

◆ abandon()

void StoreEntry::abandon ( const char *  context)
inlineinherited

One of the three methods to get rid of an unlocked StoreEntry object. May destroy this object if it is unlocked; does nothing otherwise. Unlike release(), may not trigger eviction of underlying store entries, but, unlike destroyStoreEntry(), does honor an earlier release request.

Definition at line 284 of file Store.h.

References StoreEntry::doAbandon(), and StoreEntry::locked().

Referenced by StoreEntry::unlock().

◆ abort()

◆ adjustVary()

StoreEntry * StoreEntry::adjustVary ( )
privateinherited

◆ append()

void CapturingStoreEntry::append ( char const *  buf,
int  size 
)
inlineoverridevirtual

Reimplemented from StoreEntry.

Definition at line 35 of file CapturingStoreEntry.h.

References _appended_text, and String::append().

◆ appendf()

void Packable::appendf ( const char *  fmt,
  ... 
)
inlineinherited

Definition at line 61 of file Packable.h.

References Packable::vappendf().

Referenced by Ftp::Server::acceptDataConnection(), aclParseAccessLine(), aclParseAclList(), Format::Format::assemble(), HttpStateData::buildRequestPrefix(), clientPackRangeHdr(), clientPackTermBound(), ErrorState::compileLegacyCode(), ErrorState::Dump(), EventScheduler::dump(), dump_cachemgrpasswd(), store_client::dumpStats(), Adaptation::Icap::ModXact::encapsulateHead(), Adaptation::Icap::Xaction::fillDoneStatus(), Adaptation::Icap::ModXact::fillDoneStatus(), Adaptation::Icap::Xaction::fillPendingStatus(), Adaptation::Icap::ModXact::fillPendingStatus(), HttpStateData::getMoreRequestBody(), Ftp::Server::handleEpsvReply(), Ftp::Server::handlePasvReply(), helperDispatch(), httpHdrContRangePackInto(), httpHdrRangeRespSpecPackInto(), internalRemoteUri(), Adaptation::Icap::ModXact::makeAllowHeader(), Adaptation::Icap::OptXact::makeRequest(), Adaptation::Icap::ModXact::makeRequestHeaders(), Adaptation::Icap::ModXact::makeUsernameHeader(), memBufReport(), munge_menu_line(), munge_other_line(), Adaptation::Icap::ModXact::openChunk(), HttpRequest::pack(), Http::Stream::packChunk(), HttpRequest::packFirstLineInto(), Http::StatusLine::packInto(), HttpHdrCc::packInto(), HttpHdrScTarget::packInto(), HttpHdrRangeSpec::packInto(), Helper::Client::packStatsInto(), Acl::AllOf::parse(), Ftp::PrintReply(), Ftp::Client::sendEprt(), Ftp::Client::sendPassive(), ExternalACLLookup::Start(), Ident::Start(), MemObject::stat(), statStoreEntry(), AsyncJob::status(), BodyPipe::status(), Adaptation::Ecap::XactionRep::status(), Adaptation::Icap::ServiceRep::status(), Adaptation::Icap::Xaction::status(), Http::Tunneler::status(), Comm::TcpAcceptor::status(), Ipc::Inquirer::status(), Security::PeerConnector::status(), wordlistCat(), Ftp::Server::writeCustomReply(), Ftp::Server::writeEarlyReply(), Ftp::Server::writeErrorReply(), and Http::Tunneler::writeRequest().

◆ attachToDisk()

void StoreEntry::attachToDisk ( const sdirno  dirn,
const sfileno  fno,
const swap_status_t  status 
)
inherited

Makes hasDisk(dirn, filn) true. The caller should have locked the corresponding disk store entry for reading or writing.

Definition at line 1926 of file store.cc.

References StoreEntry::checkDisk(), debugs, StoreEntry::getMD5Text(), StoreEntry::swap_dirn, StoreEntry::swap_filen, StoreEntry::swap_status, and swapStatusStr.

Referenced by Fs::Ufs::UFSSwapDir::addDiskRestore(), Rock::SwapDir::anchorEntry(), and storeSwapOutStart().

◆ buffer()

void CapturingStoreEntry::buffer ( )
inlineoverridevirtual

disable sending content to the clients.

This just sets DELAY_SENDING.

Reimplemented from StoreEntry.

Definition at line 27 of file CapturingStoreEntry.h.

References _buffer_calls.

◆ bytesWanted()

size_t StoreEntry::bytesWanted ( Range< size_t > const  aRange,
bool  ignoreDelayPool = false 
) const
inherited

◆ cacheInMemory()

void StoreEntry::cacheInMemory ( )
inherited

◆ cacheNegatively()

bool StoreEntry::cacheNegatively ( )
inherited

◆ calcPublicKey()

const cache_key * StoreEntry::calcPublicKey ( const KeyScope  keyScope)
privateinherited

Calculates correct public key for feeding forcePublicKey(). Assumes adjustVary() has been called for this entry already.

Definition at line 638 of file store.cc.

References assert, RefCount< C >::getRaw(), StoreEntry::mem_obj, MemObject::method, MemObject::request, MemObject::storeId(), storeKeyPublic(), and storeKeyPublicByRequest().

Referenced by StoreEntry::clearPublicKeyScope(), and StoreEntry::setPublicKey().

◆ checkCachable()

◆ checkDeferRead()

bool StoreEntry::checkDeferRead ( int  fd) const
inherited

Definition at line 230 of file store.cc.

References StoreEntry::bytesWanted(), and INT_MAX.

Referenced by statObjects(), and StoreEntry::swapOut().

◆ checkDisk()

◆ checkNegativeHit()

int StoreEntry::checkNegativeHit ( ) const
inherited

◆ checkTooBig()

bool StoreEntry::checkTooBig ( ) const
privateinherited

◆ checkTooSmall()

◆ clearPrivate()

void StoreEntry::clearPrivate ( )
inherited

A low-level method just resetting "private key" flags. To avoid key inconsistency please use forcePublicKey() or similar instead.

Definition at line 179 of file store.cc.

References assert, EBIT_CLR, EBIT_TEST, StoreEntry::flags, KEY_PRIVATE, RELEASE_REQUEST, and StoreEntry::shareableWhenPrivate.

Referenced by StoreEntry::forcePublicKey().

◆ clearPublicKeyScope()

void StoreEntry::clearPublicKeyScope ( )
inherited

Resets existing public key to a public key with default scope, releasing the old default-scope entry (if any). Does nothing if the existing public key already has default scope.

Definition at line 595 of file store.cc.

References StoreEntry::calcPublicKey(), EBIT_TEST, StoreEntry::flags, StoreEntry::forcePublicKey(), hash_link::key, KEY_PRIVATE, ksDefault, and storeKeyHashCmp.

Referenced by clientReplyContext::sendClientUpstreamResponse().

◆ complete()

◆ completeSuccessfully()

void StoreEntry::completeSuccessfully ( const char *  whyWeAreSureWeStoredTheWholeReply)
inherited

Signals that the entire response has been stored and no more append() calls should be expected; cf. completeTruncated().

Definition at line 1003 of file store.cc.

References StoreEntry::complete(), and debugs.

Referenced by StoreEntry::adjustVary(), FwdState::completed(), ClientHttpRequest::endRequestSatisfaction(), and StoreEntry::storeErrorResponse().

◆ completeTruncated()

void StoreEntry::completeTruncated ( const char *  whyWeConsiderTheReplyTruncated)
inherited

Signals that a partial response (if any) has been stored but no more append() calls should be expected; cf. completeSuccessfully().

Definition at line 1010 of file store.cc.

References StoreEntry::complete(), and StoreEntry::lengthWentBad().

Referenced by FwdState::completed(), and ClientHttpRequest::endRequestSatisfaction().

◆ contentLen()

int64_t StoreEntry::contentLen ( ) const
inlineinherited

◆ createMemObject() [1/2]

void StoreEntry::createMemObject ( )
inherited

initialize mem_obj; assert if mem_obj already exists avoid this method in favor of createMemObject(trio)!

Definition at line 1561 of file store.cc.

References assert, and StoreEntry::mem_obj.

Referenced by MemStore::get(), Transients::get(), Rock::SwapDir::get(), storeCreatePureEntry(), TestStoreController::testMaxSize(), TestStoreHashIndex::testMaxSize(), TestStoreController::testStats(), and TestStoreHashIndex::testStats().

◆ createMemObject() [2/2]

void StoreEntry::createMemObject ( const char *  storeId,
const char *  logUri,
const HttpRequestMethod aMethod 
)
inherited

Definition at line 1568 of file store.cc.

References assert, StoreEntry::ensureMemObject(), and StoreEntry::mem_obj.

◆ deferProducer()

void StoreEntry::deferProducer ( const AsyncCall::Pointer producer)
inherited

◆ describeTimestamps()

const char * StoreEntry::describeTimestamps ( ) const
inherited
Returns
a formatted string with entry's timestamps

Definition at line 1987 of file store.cc.

References StoreEntry::expires, StoreEntry::lastModified_, StoreEntry::lastref, LOCAL_ARRAY, and StoreEntry::timestamp.

Referenced by statStoreEntry(), and StoreEntry::timestampsSet().

◆ destroyMemObject()

◆ detachFromDisk()

void StoreEntry::detachFromDisk ( )
inherited

Makes hasDisk() false. The caller should have unlocked the corresponding disk store entry.

Definition at line 1940 of file store.cc.

References StoreEntry::swap_dirn, StoreEntry::swap_filen, StoreEntry::swap_status, and SWAPOUT_NONE.

Referenced by Rock::SwapDir::disconnect(), and Fs::Ufs::UFSSwapDir::evictCached().

◆ disk()

◆ doAbandon()

void StoreEntry::doAbandon ( const char *  context)
privateinherited

keep the unlocked StoreEntry object in the local store_table (if needed) or delete it (otherwise)

Definition at line 472 of file store.cc.

References assert, debugs, EBIT_TEST, StoreEntry::flags, Store::Controller::handleIdleEntry(), StoreEntry::locked(), StoreEntry::release(), RELEASE_REQUEST, Store::Root(), STORE_PENDING, StoreEntry::store_status, and storePendingNClients().

Referenced by StoreEntry::abandon().

◆ dump()

◆ ensureMemObject()

void StoreEntry::ensureMemObject ( const char *  storeId,
const char *  logUri,
const HttpRequestMethod aMethod 
)
inherited

◆ expireNow()

void StoreEntry::expireNow ( )
inherited

Definition at line 759 of file store.cc.

References debugs, StoreEntry::expires, StoreEntry::getMD5Text(), and squid_curtime.

◆ flush()

void CapturingStoreEntry::flush ( )
inlineoverridevirtual

flush any buffered content.

This just clears DELAY_SENDING and Invokes the handlers to begin sending anything that may be buffered.

Reimplemented from StoreEntry.

Definition at line 31 of file CapturingStoreEntry.h.

References _flush_calls.

◆ forcePublicKey()

void StoreEntry::forcePublicKey ( const cache_key newkey)
privateinherited

Unconditionally sets public key for this store entry. Releases the old entry with the same public key (if any).

Definition at line 612 of file store.cc.

References assert, StoreEntry::clearPrivate(), debugs, StoreEntry::hasDisk(), hash_lookup(), StoreEntry::hashDelete(), StoreEntry::hashInsert(), MemObject::hasUris(), hash_link::key, StoreEntry::mem_obj, store_table, storeDirSwapLog(), storeKeyText(), and SWAP_LOG_ADD.

Referenced by StoreEntry::clearPublicKeyScope(), and StoreEntry::setPublicKey().

◆ getMD5Text()

◆ getSerialisedMetaData()

char const * StoreEntry::getSerialisedMetaData ( size_t length) const
inherited
Returns
a malloc()ed buffer containing a length-long packed swap header

Definition at line 1736 of file store.cc.

References Store::PackSwapMeta().

Referenced by storeSwapOutStart().

◆ hasDisk()

◆ hasEtag()

bool StoreEntry::hasEtag ( ETag etag) const
inherited

Definition at line 1848 of file store.cc.

References Http::ETAG, StoreEntry::hasFreshestReply(), and ETag::str.

Referenced by clientReplyContext::processExpired().

◆ hasFreshestReply()

const HttpReply * StoreEntry::hasFreshestReply ( ) const
inlineinherited
Return values
*the address of freshest reply (if mem_obj exists)
nullptrwhen mem_obj does not exist
See also
MemObject::freshestReply()

Definition at line 57 of file Store.h.

References MemObject::freshestReply(), and StoreEntry::mem_obj.

Referenced by StoreEntry::hasEtag(), and refreshCheck().

◆ hashDelete()

void StoreEntry::hashDelete ( )
inherited

◆ hashInsert()

◆ hasIfMatchEtag()

bool StoreEntry::hasIfMatchEtag ( const HttpRequest request) const
inherited

◆ hasIfNoneMatchEtag()

◆ hasMemStore()

◆ hasOneOfEtags()

bool StoreEntry::hasOneOfEtags ( const String reqETags,
const bool  allowWeakMatch 
) const
privateinherited

◆ hasTransients()

◆ hittingRequiresCollapsing()

◆ inUseCount()

size_t StoreEntry::inUseCount ( )
staticinherited

◆ invokeHandlers()

◆ isAccepting()

◆ isEmpty()

◆ kickProducer()

void StoreEntry::kickProducer ( )
inherited

Definition at line 362 of file store.cc.

References StoreEntry::deferredProducer, and ScheduleCallHere.

Referenced by store_client::copy(), and storeUnregister().

◆ lastModified() [1/2]

time_t StoreEntry::lastModified ( ) const
inlineinherited
Returns
entry's 'effective' modification time

Definition at line 178 of file Store.h.

References StoreEntry::lastModified_, and StoreEntry::timestamp.

Referenced by StoreEntry::modifiedSince(), and StoreEntry::timestampsSet().

◆ lastModified() [2/2]

◆ lengthWentBad()

void StoreEntry::lengthWentBad ( const char *  reason)
privateinherited

◆ lock()

◆ locked()

◆ locks()

int StoreEntry::locks ( ) const
inlineinherited

Definition at line 269 of file Store.h.

References StoreEntry::lock_count.

Referenced by statStoreEntry().

◆ makePrivate()

void StoreEntry::makePrivate ( const bool  shareable)
inherited

◆ makePublic()

◆ mayStartHitting()

bool StoreEntry::mayStartHitting ( ) const
inlineinherited

May the caller commit to treating this [previously locked] entry as a cache hit?

Definition at line 288 of file Store.h.

References EBIT_TEST, StoreEntry::flags, KEY_PRIVATE, and StoreEntry::shareableWhenPrivate.

Referenced by clientReplyContext::cacheHit(), and clientReplyContext::handleIMSReply().

◆ mayStartSwapOut()

◆ mem() [1/2]

◆ mem() [2/2]

const MemObject & StoreEntry::mem ( ) const
inlineinherited

Definition at line 52 of file Store.h.

References assert, and StoreEntry::mem_obj.

◆ memoryCachable()

◆ memOutDecision()

void StoreEntry::memOutDecision ( const bool  willCacheInRam)
inherited

◆ MEMPROXY_CLASS()

CapturingStoreEntry::MEMPROXY_CLASS ( CapturingStoreEntry  )
private

◆ modifiedSince()

bool StoreEntry::modifiedSince ( const time_t  ims,
const int  imslen = -1 
) const
inherited

◆ negativeCache()

void StoreEntry::negativeCache ( )
inherited

Set object for negative caching. Preserves any expiry information given by the server. In absence of proper expiry info it will set to expire immediately, or with HTTP-violations enabled the configured negative-TTL is observed

Definition at line 1307 of file store.cc.

References Config, debugs, EBIT_SET, ENTRY_NEGCACHED, StoreEntry::expires, StoreEntry::flags, SquidConfig::negativeTtl, and squid_curtime.

Referenced by StoreEntry::abort(), StoreEntry::cacheNegatively(), and StoreEntry::storeErrorResponse().

◆ objectLen()

◆ operator delete()

void StoreEntry::operator delete ( void *  address)
inherited

Definition at line 160 of file store.cc.

◆ operator new()

void * StoreEntry::operator new ( size_t  byteCount)
inherited

Definition at line 148 of file store.cc.

References assert, and memPoolCreate.

◆ publicKey()

const cache_key * StoreEntry::publicKey ( ) const
inlineinherited
Returns
public key (if the entry has it) or nil (otherwise)

Definition at line 113 of file Store.h.

References EBIT_TEST, StoreEntry::flags, hash_link::key, and KEY_PRIVATE.

Referenced by Rock::SwapDir::evictCached(), MemStore::evictCached(), Store::Disks::evictCached(), and Rock::SwapDir::openStoreIO().

◆ registerAbortCallback()

void StoreEntry::registerAbortCallback ( const AsyncCall::Pointer handler)
inherited

Definition at line 1467 of file store.cc.

References MemObject::abortCallback, assert, handler(), and StoreEntry::mem_obj.

Referenced by Ftp::Relay::Relay(), and FwdState::start().

◆ release()

void StoreEntry::release ( const bool  shareable = false)
inherited

◆ releaseRequest()

◆ replaceHttpReply()

◆ reset()

◆ setCollapsingRequirement()

◆ setMemStatus()

◆ setNoDelay()

void StoreEntry::setNoDelay ( bool const  newValue)
inherited

Definition at line 236 of file store.cc.

References StoreEntry::mem_obj, and MemObject::setNoDelay().

Referenced by HttpStateData::HttpStateData().

◆ setPrivateKey()

void StoreEntry::setPrivateKey ( const bool  shareable,
const bool  permanent 
)
inherited

Either fills this entry with private key or changes the existing key from public to private.

Parameters
permanentwhether this entry should be private forever.

Definition at line 534 of file store.cc.

References assert, debugs, EBIT_SET, EBIT_TEST, Store::Controller::evictCached(), StoreEntry::flags, getKeyCounter(), hash_lookup(), StoreEntry::hashDelete(), StoreEntry::hashInsert(), MemObject::hasUris(), MemObject::id, hash_link::key, KEY_PRIVATE, StoreEntry::mem_obj, RELEASE_REQUEST, Store::Root(), StoreEntry::shareableWhenPrivate, store_table, and storeKeyPrivate().

Referenced by StoreEntry::releaseRequest(), and storeCreateEntry().

◆ setPublicKey()

◆ startWriting()

◆ storeClientType()

◆ storeErrorResponse()

◆ storeWriterDone()

void StoreEntry::storeWriterDone ( )
inherited

◆ storeWritingCheckpoint()

void StoreEntry::storeWritingCheckpoint ( )
protectedinherited

If needed, signal transient entry readers that no more cache changes are expected and, hence, they should switch to Plan B instead of getting stuck waiting for us to start or finish storing the entry.

Definition at line 1747 of file store.cc.

References assert, debugs, MemObject::SwapOut::decision, StoreEntry::hasTransients(), MemObject::MemCache::io, Store::ioDone, StoreEntry::mem_obj, MemObject::memCache, Store::Controller::noteStoppedSharedWriting(), Store::Root(), MemObject::swapout, StoreEntry::swappingOut(), MemObject::SwapOut::swImpossible, and MemObject::SwapOut::swStarted.

Referenced by StoreEntry::memOutDecision(), StoreEntry::storeWriterDone(), and StoreEntry::swapOutDecision().

◆ swapOut()

◆ swapOutDecision()

void StoreEntry::swapOutDecision ( const MemObject::SwapOut::Decision decision)
inherited

◆ swapoutFailed()

bool StoreEntry::swapoutFailed ( ) const
inlineinherited

◆ swapOutFileClose()

void StoreEntry::swapOutFileClose ( int  how)
inherited

◆ swappedOut()

◆ swappingOut()

◆ timestampsSet()

◆ touch()

void StoreEntry::touch ( )
inherited

Definition at line 438 of file store.cc.

References StoreEntry::lastref, and squid_curtime.

◆ trimMemory()

void StoreEntry::trimMemory ( const bool  preserveSwappable)
inherited

◆ unlock()

◆ unregisterAbortCallback()

void StoreEntry::unregisterAbortCallback ( const char *  reason)
inherited

Avoid notifying anybody about a 3rd-party initiated StoreEntry abort. Calling this method does not cancel the already queued notification. TODO: Refactor to represent the end of (shared) ownership by our writer.

Definition at line 1475 of file store.cc.

References MemObject::abortCallback, assert, AsyncCall::cancel(), and StoreEntry::mem_obj.

Referenced by FwdState::~FwdState().

◆ updateOnNotModified()

bool StoreEntry::updateOnNotModified ( const StoreEntry e304)
inherited

Updates easily-accessible non-Store-specific parts of the entry. Use Controller::updateOnNotModified() instead of this helper.

Returns
whether anything was actually updated

Definition at line 1438 of file store.cc.

References MemObject::appliedUpdates, assert, MemObject::baseReply(), Config, debugs, MemObject::freshestReply(), Here, SquidConfig::maxReplyHeaderSize, StoreEntry::mem_obj, HttpReply::recreateOnNotModified(), StoreEntry::timestampsSet(), ToSBuf(), and MemObject::updateReply().

Referenced by Store::Controller::updateOnNotModified().

◆ url()

◆ validLength()

bool StoreEntry::validLength ( ) const
privateinherited

whether the base response has all the body bytes we expect

Returns
true for responses with unknown/unspecified body length
true for responses with the right number of accumulated body bytes

Definition at line 1190 of file store.cc.

References assert, MemObject::baseReply(), debugs, StoreEntry::getMD5Text(), StoreEntry::mem_obj, MemObject::method, Http::METHOD_HEAD, StoreEntry::objectLen(), Http::scNoContent, and Http::scNotModified.

Referenced by StoreEntry::complete().

◆ validToSend()

◆ vappendf()

void StoreEntry::vappendf ( const char *  fmt,
va_list  ap 
)
overridevirtualinherited

Append operation, with vsprintf(3)-style arguments.

Note
arguments may be evaluated more than once, be careful of side-effects

XXX: This method either should not exist or should not be virtual. Kids should not be forced to re-implement vappendf() logic. That logic should be implemented once, using other [Packable] APIs. Packable is not about providing a printf(3) service. Packable is about writing opaque data to various custom destinations.

Implements Packable.

Definition at line 807 of file store.cc.

References StoreEntry::append(), assert, fatal(), LOCAL_ARRAY, and xstrerr().

Referenced by storeAppendPrintf(), and storeAppendVPrintf().

◆ write()

Member Data Documentation

◆ _appended_text

String CapturingStoreEntry::_appended_text

Definition at line 23 of file CapturingStoreEntry.h.

Referenced by append(), and TestPackableStream::testGetStream().

◆ _buffer_calls

int CapturingStoreEntry::_buffer_calls

Definition at line 24 of file CapturingStoreEntry.h.

Referenced by buffer(), and TestPackableStream::testGetStream().

◆ _flush_calls

int CapturingStoreEntry::_flush_calls

Definition at line 25 of file CapturingStoreEntry.h.

Referenced by flush(), and TestPackableStream::testGetStream().

◆ cachedESITree

ESIElement::Pointer StoreEntry::cachedESITree
inherited

◆ deferredProducer

AsyncCall::Pointer StoreEntry::deferredProducer
privateinherited

Definition at line 335 of file Store.h.

Referenced by StoreEntry::deferProducer(), and StoreEntry::kickProducer().

◆ expires

◆ flags

uint16_t StoreEntry::flags
inherited

Definition at line 232 of file Store.h.

Referenced by StoreEntry::abort(), Fs::Ufs::UFSSwapDir::addDiskRestore(), addedEntry(), Store::Controller::addWriting(), Rock::SwapDir::anchorEntry(), MemStore::anchorEntry(), asHandleReply(), StoreEntry::buffer(), clientReplyContext::buildReplyHeader(), clientReplyContext::cacheHit(), Store::Disk::canLog(), Store::Disk::canStore(), StoreEntry::checkCachable(), StoreEntry::checkDisk(), StoreEntry::checkNegativeHit(), CheckQuickAbortIsReasonable(), Store::CheckSwapMetaKey(), StoreEntry::checkTooSmall(), Store::Controller::checkTransients(), StoreEntry::clearPrivate(), StoreEntry::clearPublicKeyScope(), StoreEntry::complete(), FwdState::completed(), store_client::copy(), MemStore::copyToShm(), Store::Controller::dereferenceIdle(), FwdState::dispatch(), StoreEntry::doAbandon(), dummy_action(), errorAppendEntry(), clientReplyContext::errorInStream(), Store::Disks::evictCached(), Ipc::StoreMapAnchor::exportInto(), StoreEntry::flush(), Store::Controller::handleIdleEntry(), clientReplyContext::handleIMSReply(), Http::One::Server::handleReply(), HttpStateData::haveParsedReplyHeaders(), heap_add(), StoreEntry::hittingRequiresCollapsing(), httpMaybeRemovePublic(), StoreEntry::invokeHandlers(), StoreEntry::isAccepting(), StoreEntry::lengthWentBad(), MimeIcon::load(), Fs::Ufs::UFSSwapDir::logEntry(), StoreEntry::makePublic(), FwdState::markStoredReplyAsWhole(), StoreEntry::mayStartHitting(), StoreEntry::mayStartSwapOut(), StoreEntry::negativeCache(), neighborsHtcpReply(), neighborsUdpAck(), netdbExchangeHandleReply(), peerDigestFetchedEnough(), peerDigestRequest(), peerSelectIcpPing(), clientReplyContext::processExpired(), clientReplyContext::processMiss(), HttpStateData::processReply(), HttpStateData::processReplyBody(), StoreEntry::publicKey(), HttpStateData::readReply(), Fs::Ufs::RebuildState::rebuildFromDirectory(), Store::Controller::referenceBusy(), FwdState::reforward(), refreshCheck(), StoreEntry::releaseRequest(), clientReplyContext::replyStatus(), HttpStateData::reusableReply(), clientReplyContext::sendClientOldEntry(), clientReplyContext::sendClientUpstreamResponse(), Client::sentRequestBody(), Ipc::StoreMapAnchor::set(), StoreEntry::setCollapsingRequirement(), Client::setFinalReply(), StoreEntry::setMemStatus(), StoreEntry::setPrivateKey(), StoreEntry::setPublicKey(), MemStore::shouldCache(), statObjects(), storeCleanup(), StoreEntry::storeClientType(), storeCreatePureEntry(), storeDigestAddable(), storeDigestDel(), storeDigestRewriteResume(), storeDirSwapLog(), storeEntryFlags(), storeRebuildParseEntry(), storeSwapInStart(), StoreEntry::swapOut(), Store::Controller::syncCollapsed(), TestCacheManager::testRegister(), StoreEntry::trimMemory(), Store::UnpackIndexSwapMeta(), Store::Controller::updateOnNotModified(), urnHandleReply(), StoreEntry::validToSend(), UFSCleanLog::write(), and StoreEntry::write().

◆ key

void* hash_link::key
inherited

Definition at line 19 of file hash.h.

Referenced by ClientInfo::ClientInfo(), fqdncache_entry::fqdncache_entry(), IdleConnList::IdleConnList(), ipcache_entry::ipcache_entry(), net_db_name::net_db_name(), ClientInfo::~ClientInfo(), ExternalACLEntry::~ExternalACLEntry(), fqdncache_entry::~fqdncache_entry(), IdleConnList::~IdleConnList(), net_db_name::~net_db_name(), aclMatchExternal(), Rock::SwapDir::anchorToCache(), MemStore::anchorToCache(), Store::CheckSwapMetaKey(), StoreEntry::clearPublicKeyScope(), Rock::SwapDir::createStoreIO(), CommQuotaQueue::dequeue(), destroyStoreEntry(), CommQuotaQueue::enqueue(), external_acl_cache_add(), StoreEntry::forcePublicKey(), fqdncacheAddEntry(), fqdncacheParse(), StoreEntry::getMD5Text(), hash_join(), hash_remove_link(), StoreEntry::hashDelete(), StoreEntry::hashInsert(), hashKeyStr(), Rock::SwapDir::hasReadableEntry(), htcpQuery(), idnsStartQuery(), ipcacheAddEntry(), ipcacheRelease(), Fs::Ufs::UFSSwapDir::logEntry(), Store::Controller::markedForDeletionAndAbandoned(), my_free(), ipcache_entry::name(), neighborsUdpPing(), netdbHashInsert(), Ipc::StoreMap::openForUpdating(), Store::PackFields(), peerCountMcastPeersCreateAndSend(), StoreEntry::publicKey(), read_passwd_file(), Ipc::StoreMapAnchor::set(), StoreEntry::setPrivateKey(), StoreEntry::setPublicKey(), ClientInfo::setWriteLimiter(), Ident::Start(), MemStore::startCaching(), storeDigestAdd(), storeDigestDel(), storeRebuildParseEntry(), Store::UnpackIndexSwapMeta(), and UFSCleanLog::write().

◆ lastModified_

time_t StoreEntry::lastModified_
privateinherited

◆ lastref

◆ lock_count

unsigned short StoreEntry::lock_count
privateinherited

◆ mem_obj

MemObject* StoreEntry::mem_obj
inherited

Definition at line 221 of file Store.h.

Referenced by StoreEntry::abort(), Store::Disks::accumulateMore(), Transients::addEntry(), Transients::addReaderEntry(), Transients::addWriterEntry(), StoreEntry::adjustVary(), MemStore::anchorEntry(), StoreEntry::append(), CollapsedForwarding::Broadcast(), StoreEntry::bytesWanted(), clientReplyContext::cacheHit(), StoreEntry::calcPublicKey(), StoreEntry::checkCachable(), CheckQuickAbortIsReasonable(), StoreEntry::checkTooBig(), StoreEntry::checkTooSmall(), FwdState::complete(), StoreEntry::complete(), FwdState::completed(), Transients::completeWriting(), MemStore::completeWriting(), store_client::copy(), MemStore::copyFromShm(), MemStore::copyFromShmSlice(), MemStore::copyToShm(), MemStore::copyToShmSlice(), StoreEntry::createMemObject(), Store::Controller::dereferenceIdle(), StoreEntry::destroyMemObject(), Transients::disconnect(), MemStore::disconnect(), Rock::SwapDir::disconnect(), store_client::doCopy(), doPages(), StoreEntry::dump(), StoreEntry::ensureMemObject(), errorAppendEntry(), FwdState::establishTunnelThruProxy(), MemStore::evictCached(), Transients::evictCached(), store_client::fileRead(), Rock::SwapDir::finalizeSwapoutSuccess(), findPreviouslyCachedEntry(), StoreEntry::forcePublicKey(), Transients::get(), store_client::handleBodyFromDisk(), Store::Controller::handleIdleEntry(), StoreEntry::hasFreshestReply(), StoreEntry::hasMemStore(), StoreEntry::hasTransients(), Transients::hasWriter(), HttpStateData::haveParsedReplyHeaders(), heap_guessType(), HeapKeyGen_StoreEntry_GDSF(), HeapKeyGen_StoreEntry_LFUDA(), HeapKeyGen_StoreEntry_LRU(), httpMaybeRemovePublic(), StoreEntry::invokeHandlers(), Transients::isReader(), Transients::isWriter(), Store::Controller::keepForLocalMemoryCache(), MimeIcon::load(), store_client::maybeWriteFromDiskToMemory(), StoreEntry::mayStartSwapOut(), StoreEntry::mem(), StoreEntry::memoryCachable(), StoreEntry::memOutDecision(), Transients::monitorIo(), neighborsHtcpReply(), neighborsUdpAck(), neighborsUdpPing(), objectSizeForDirSelection(), peerCountHandleIcpReply(), peerCountMcastPeersAbort(), peerCountMcastPeersCreateAndSend(), peerDigestFetchReply(), peerDigestFetchSetStats(), peerDigestSwapInCBlock(), Transients::readers(), store_client::readFromMemory(), store_client::readHeader(), HttpStateData::readReply(), Store::Controller::referenceBusy(), FwdState::reforward(), refreshCheck(), refreshCheckDigest(), refreshIsCachable(), StoreEntry::registerAbortCallback(), repl_guessType(), StoreEntry::replaceHttpReply(), StoreEntry::setMemStatus(), StoreEntry::setNoDelay(), HeapPolicyData::setPolicyNode(), LruPolicyData::setPolicyNode(), StoreEntry::setPrivateKey(), StoreEntry::setPublicKey(), MemStore::shouldCache(), store_client::skipHttpHeadersFromDisk(), FwdState::Start(), MemStore::startCaching(), StoreEntry::startWriting(), statObjectsOpenfdFilter(), statObjectsVmFilter(), statStoreEntry(), Transients::status(), storeClientListAdd(), StoreEntry::storeClientType(), storeDigestRewriteFinish(), storeDigestRewriteStart(), storeLog(), clientReplyContext::storeNotOKTransferDone(), storePendingNClients(), storeSwapInStart(), storeSwapOutFileClosed(), storeSwapOutStart(), storeUnregister(), StoreEntry::storeWritingCheckpoint(), StoreEntry::swapOut(), StoreEntry::swapOutDecision(), StoreEntry::swapOutFileClose(), Store::Controller::syncCollapsed(), TestRock::testRockSwapOut(), StoreEntry::timestampsSet(), StoreEntry::trimMemory(), StoreEntry::unregisterAbortCallback(), MemStore::updateAnchored(), MemStore::updateHeaders(), StoreEntry::updateOnNotModified(), Store::Controller::updateOnNotModified(), StoreEntry::url(), StoreEntry::validLength(), StoreEntry::validToSend(), varyEvaluateMatch(), MemStore::write(), StoreEntry::write(), and HttpStateData::wroteLast().

◆ mem_status

◆ next

◆ ping_status

◆ pool

Mem::Allocator * StoreEntry::pool = nullptr
staticprivateinherited

Definition at line 322 of file Store.h.

Referenced by StoreEntry::inUseCount().

◆ refcount

◆ repl

◆ shareableWhenPrivate

bool StoreEntry::shareableWhenPrivate
privateinherited

Nobody can find/lock KEY_PRIVATE entries, but some transactions (e.g., collapsed requests) find/lock a public entry before it becomes private. May such transactions start using the now-private entry they previously locked? This member should not affect transactions that already started reading from the entry.

Definition at line 331 of file Store.h.

Referenced by StoreEntry::clearPrivate(), StoreEntry::mayStartHitting(), StoreEntry::releaseRequest(), and StoreEntry::setPrivateKey().

◆ store_status

◆ swap_dirn

◆ swap_file_sz

◆ swap_filen

◆ swap_status

◆ timestamp


The documentation for this class was generated from the following file:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors