store_client.cc
Go to the documentation of this file.
376 if (!sendHttpHeaders && anEntry->store_status == STORE_PENDING && nextHttpReadOffset() >= mem->endOffset()) {
530 const auto nextStoreReadOffset = NaturalSum<int64_t>(mem->swap_hdr_sz, nextHttpReadOffset()).value();
642 if (httpResponsePart.length && entry->mem_obj->inmem_lo == 0 && entry->objectLen() <= (int64_t)Config.Store.maxInMemObjSize && Config.onoff.memory_cache_disk) {
690 _callback.notifier = asyncCall(90, 4, "store_client::FinishCallback", cbdataDialer(store_client::FinishCallback, this));
735 debugs(90, DBG_IMPORTANT, "ERROR: Failed to unpack Store entry metadata: " << CurrentException);
769 debugs(90, 3, "storeUnregister: Consistency failure - store client being unregistered is not in the mem object's list for '" << e->getMD5Text() << "'");
958 debugs(90, 3, "quick-abort? YES bad content length (" << curlen << " of " << expectlen << " bytes received)");
1016 if (adjustableReply.parseTerminatedPrefix(parsingBuffer->c_str(), parsingBuffer->contentSize()))
1034 debugs(90, 5, "discovered " << hdr_sz << "-byte HTTP headers in memory after reading some of them from disk: " << *parsingBuffer);
RefCount< AsyncCallT< Dialer > > asyncCall(int aDebugSection, int aDebugLevel, const char *aName, const Dialer &aDialer)
Definition: AsyncCall.h:156
UnaryCbdataDialer< Argument1 > cbdataDialer(typename UnaryCbdataDialer< Argument1 >::Handler *handler, Argument1 *arg1)
Definition: AsyncCbdataCalls.h:40
constexpr bool Less(const A a, const B b)
whether integer a is less than integer b, with correct overflow handling
Definition: SquidMath.h:48
int storeClientIsThisAClient(store_client *sc, void *someClient)
std::ostream & CurrentException(std::ostream &os)
prints active (i.e., thrown but not yet handled) exception
Definition: TextException.cc:88
void error(char *format,...)
Definition: FilledChecklist.h:32
virtual void fillChecklist(ACLFilledChecklist &) const =0
configure the given checklist (to reflect the current transaction state)
Definition: CodeContext.h:53
static void Reset()
forgets the current context, setting it to nil/unknown
Definition: CodeContext.cc:77
Definition: DelayId.h:22
Definition: MemBuf.h:24
Definition: MemObject.h:34
void appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
Append operation with printf-style arguments.
Definition: Packable.h:61
struct SquidConfig::@107 accessList
struct SquidConfig::@106 onoff
struct SquidConfig::@92 quickAbort
acl_access * collapsedForwardingAccess
Definition: SquidConfig.h:406
struct SquidConfig::@104 Store
struct StatCounters::@131 swap
bool onCollapsingPath() const
whether Squid configuration allows collapsing for this transaction
Definition: store_client.cc:52
virtual LogTags * loggingTags() const =0
bool startCollapsingOn(const StoreEntry &, const bool doingRevalidation) const
Definition: store_client.cc:66
Definition: Store.h:42
bool swappedOut() const
whether the entire entry is now on disk (possibly marked for deletion)
Definition: Store.h:136
bool hasDisk(const sdirno dirn=-1, const sfileno filen=-1) const
Definition: store.cc:1915
bool swappingOut() const
whether we are in the process of writing this entry to disk
Definition: Store.h:134
bool hittingRequiresCollapsing() const
whether this entry can feed collapsed requests and only them
Definition: Store.h:216
Definition: StoreIOBuffer.h:16
StoreIOBuffer & positionAt(const int64_t newOffset)
convenience method for changing the offset of a being-configured buffer
Definition: StoreIOBuffer.h:47
void STRCB(void *their_data, const char *buf, ssize_t len, StoreIOState::Pointer self)
Definition: StoreIOState.h:29
Definition: cbdata.cc:38
Definition: dlink.h:15
Definition: StoreClient.h:70
void readHeader(const char *buf, ssize_t len)
Definition: store_client.cc:711
void skipHttpHeadersFromDisk()
skips HTTP header bytes previously loaded from disk
Definition: store_client.cc:1029
void handleBodyFromDisk()
de-serializes HTTP response (partially) read from disk storage
Definition: store_client.cc:611
struct store_client::@140 flags
std::optional< Store::ParsingBuffer > parsingBuffer
Definition: StoreClient.h:187
bool startSwapin()
opens the swapin "file" if possible; otherwise, fail()s and returns false
Definition: store_client.cc:420
void noteNews()
if necessary and possible, informs the Store reader about copy() result
Definition: store_client.cc:671
bool parseHttpHeadersFromDisk()
Definition: store_client.cc:991
bool moreToRead() const
Whether Store has (or possibly will have) more entry data for us.
Definition: store_client.cc:294
int64_t nextHttpReadOffset() const
The offset of the next stored HTTP response byte wanted by the client.
Definition: store_client.cc:492
void copy(StoreEntry *, StoreIOBuffer, STCB *, void *)
Definition: store_client.cc:224
void maybeWriteFromDiskToMemory(const StoreIOBuffer &)
Definition: store_client.cc:634
bool canReadFromMemory() const
whether at least one byte wanted by the client is in memory
Definition: store_client.cc:482
struct store_client::Callback _callback
void finishCallback()
finishes a copy()-STCB sequence by synchronously calling STCB
Definition: store_client.cc:153
static void FinishCallback(store_client *)
finishCallback() wrapper; TODO: Add NullaryMemFunT for non-jobs.
Definition: store_client.cc:146
void dumpStats(MemBuf *output, int clientNumber) const
Definition: store_client.cc:1045
void UnpackHitSwapMeta(char const *, ssize_t, StoreEntry &)
deserializes entry metadata from the given buffer into the cache hit entry
Definition: SwapMetaIn.cc:310
int storeUnregister(store_client *sc, StoreEntry *e, void *data)
Definition: store_client.cc:749
void storeClientCopy(store_client *sc, StoreEntry *e, StoreIOBuffer copyInto, STCB *callback, void *data)
Definition: store_client.cc:213
static void storeClientCopy2(StoreEntry *e, store_client *sc)
Definition: store_client.cc:319
store_client * storeClientListAdd(StoreEntry *e, void *data)
Definition: store_client.cc:123
static bool CheckQuickAbortIsReasonable(StoreEntry *entry)
Definition: store_client.cc:884
void storeRead(StoreIOState::Pointer sio, char *buf, size_t size, off_t offset, StoreIOState::STRCB *callback, void *callback_data)
Definition: store_io.cc:79
Definition: parse.c:104
Definition: StoreClient.h:195
Callback()=default
AsyncCall::Pointer notifier
a scheduled asynchronous finishCallback() call (or nil)
Definition: StoreClient.h:210