stub_store.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2019 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #include "squid.h"
10 #include "RequestFlags.h"
11 
12 #define STUB_API "store.cc"
13 #include "tests/STUB.h"
14 
15 const char *storeStatusStr[] = { };
16 const char *pingStatusStr[] = { };
17 const char *memStatusStr[] = { };
18 const char *swapStatusStr[] = { };
19 
20 #include "RemovalPolicy.h"
22 
23 #include "Store.h"
25 bool StoreEntry::checkDeferRead(int fd) const STUB_RETVAL(false)
26 const char *StoreEntry::getMD5Text() const STUB_RETVAL(NULL)
30 bool StoreEntry::isAccepting() const STUB_RETVAL(false)
31 size_t StoreEntry::bytesWanted(Range<size_t> const, bool) const STUB_RETVAL(0)
34 char const *StoreEntry::getSerialisedMetaData(size_t &length) const STUB_RETVAL(NULL)
35 void StoreEntry::replaceHttpReply(const HttpReplyPointer &, bool andStartWriting) STUB
37 void StoreEntry::trimMemory(const bool preserveSwappable) STUB
39 bool StoreEntry::makePublic(const KeyScope scope) STUB
40 void StoreEntry::makePrivate(const bool shareable) STUB
41 bool StoreEntry::setPublicKey(const KeyScope scope) STUB
42 void StoreEntry::setPrivateKey(const bool, const bool) STUB
44 void StoreEntry::releaseRequest(const bool shareable) STUB
49 const char *StoreEntry::url() const STUB_RETVAL(NULL)
55 void StoreEntry::createMemObject(const char *, const char *, const HttpRequestMethod &aMethod) STUB
56 void StoreEntry::ensureMemObject(const char *, const char *, const HttpRequestMethod &) STUB
57 void StoreEntry::dump(int debug_lvl) const STUB
60 void StoreEntry::registerAbort(STABH * cb, void *) STUB
68 void StoreEntry::setNoDelay (bool const) STUB
69 bool StoreEntry::modifiedSince(const time_t, const int) const STUB_RETVAL(false)
70 bool StoreEntry::hasIfMatchEtag(const HttpRequest &request) const STUB_RETVAL(false)
71 bool StoreEntry::hasIfNoneMatchEtag(const HttpRequest &request) const STUB_RETVAL(false)
76 void StoreEntry::getPublic(StoreClient * aClient, const char *uri, const HttpRequestMethod& method) STUB
77 void *StoreEntry::operator new(size_t byteCount)
78 {
79  STUB
80  return new StoreEntry();
81 }
82 void StoreEntry::operator delete(void *address) STUB
83 //#if USE_SQUID_ESI
84 //ESIElement::Pointer StoreEntry::cachedESITree STUB_RETVAL(NULL)
85 //#endif
88 int StoreEntry::unlock(const char *) STUB_RETVAL(0)
89 void StoreEntry::lock(const char *) STUB
91 void StoreEntry::release(const bool shareable) STUB
92 void StoreEntry::append(char const *, int) STUB
93 void StoreEntry::vappendf(const char *, va_list) STUB
94 void StoreEntry::setCollapsingRequirement(const bool required) STUB
95 
96 void Store::Maintain(void *unused) STUB
97 
98 std::ostream &operator <<(std::ostream &os, const StoreEntry &)
99 {
100  STUB
101  return os;
102 }
103 
104 size_t storeEntryInUse() STUB_RETVAL(0)
106 StoreEntry *storeGetPublic(const char *uri, const HttpRequestMethod& method) STUB_RETVAL(NULL)
109 StoreEntry *storeCreateEntry(const char *, const char *, const RequestFlags &, const HttpRequestMethod&) STUB_RETVAL(NULL)
110 StoreEntry *storeCreatePureEntry(const char *storeId, const char *logUrl, const HttpRequestMethod&) STUB_RETVAL(nullptr)
111 void storeConfigure(void) STUB
112 int expiresMoreThan(time_t, time_t) STUB_RETVAL(0)
113 void storeAppendPrintf(StoreEntry *, const char *,...) STUB
114 void storeAppendVPrintf(StoreEntry *, const char *, va_list ap) STUB
118 void storeFsInit(void) STUB
119 void storeFsDone(void) STUB
120 void storeReplAdd(const char *, REMOVALPOLICYCREATE *) STUB
121 void destroyStoreEntry(void *) STUB
122 void storeGetMemSpace(int size) STUB
123 
const char * getMD5Text() const
Definition: store.cc:185
void storeReplAdd(const char *type, REMOVALPOLICYCREATE *create)
Definition: store.cc:1693
void makePrivate(const bool shareable)
Definition: store.cc:152
bool modifiedSince(const time_t ims, const int imslen=-1) const
Definition: store.cc:1889
void touch()
update last reference timestamp and related Store metadata
Definition: store.cc:446
static void getPublicByRequestMethod(StoreClient *aClient, HttpRequest *request, const HttpRequestMethod &method)
Definition: store.cc:501
void release(const bool shareable=false)
Definition: store.cc:1191
int unlock(const char *context)
Definition: store.cc:463
void storeEntryReplaceObject(StoreEntry *, HttpReply *)
bool timestampsSet()
Definition: store.cc:1440
virtual void append(char const *, int)
Appends a c-string to existing packed data.
Definition: store.cc:829
unsigned char cache_key
Store key.
Definition: forward.h:29
virtual ~StoreEntry()
Definition: store.cc:351
virtual void buffer()
Definition: store.cc:1649
void expireNow()
Definition: store.cc:797
static size_t inUseCount()
Definition: store.cc:177
void ensureMemObject(const char *storeId, const char *logUri, const HttpRequestMethod &aMethod)
initialize mem_obj (if needed) and set URIs/method (if missing)
Definition: store.cc:1637
Definition: Range.h:18
int validToSend() const
Definition: store.cc:1400
virtual void flush()
Definition: store.cc:1660
StoreEntry * storeGetPublicByRequestMethod(HttpRequest *req, const HttpRequestMethod &method, const KeyScope keyScope)
Definition: store.cc:528
bool isAccepting() const
Definition: store.cc:2042
void delayAwareRead(const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer callback)
Definition: store.cc:203
void storeFsDone(void)
const char * pingStatusStr[]
Definition: stub_store.cc:16
int storeTooManyDiskFilesOpen(void)
Definition: store.cc:917
void destroyMemObject()
Definition: store.cc:378
static void getPublicByRequest(StoreClient *aClient, HttpRequest *request)
Definition: store.cc:508
RemovalPolicy * REMOVALPOLICYCREATE(wordlist *args)
Definition: RemovalPolicy.h:80
void complete()
Definition: store.cc:1063
store_client_t storeClientType() const
Definition: store.cc:267
static void getPublic(StoreClient *aClient, const char *uri, const HttpRequestMethod &method)
Definition: store.cc:515
const char * swapStatusStr[]
Definition: stub_store.cc:18
void hashDelete()
Definition: store.cc:427
void hashInsert(const cache_key *)
Definition: store.cc:418
store_client_t
Definition: enums.h:67
StoreEntry()
Definition: store.cc:330
const char * url() const
Definition: store.cc:1614
StoreEntry * storeCreateEntry(const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
Definition: store.cc:783
void abort()
Definition: store.cc:1109
bool checkCachable()
Definition: store.cc:957
RemovalPolicy * createRemovalPolicy(RemovalPolicySettings *settings) STUB_RETVAL(NULL) StoreIoStats store_io_stats
Definition: store.cc:1719
#define STUB
macro to stub a void function.
Definition: STUB.h:33
bool setPublicKey(const KeyScope keyScope=ksDefault)
Definition: store.cc:593
Store statistics related to low-level I/O.
Definition: StoreStats.h:57
void releaseRequest(const bool shareable=false)
Definition: store.cc:452
std::ostream & operator<<(std::ostream &o, const Acl::Answer a)
Definition: Acl.h:161
virtual void vappendf(const char *, va_list)
Definition: store.cc:847
void setNoDelay(bool const)
Definition: store.cc:253
void replaceHttpReply(const HttpReplyPointer &, const bool andStartWriting=true)
Definition: store.cc:1774
signed_int32_t sfileno
Definition: forward.h:22
int checkTooSmall()
Definition: store.cc:929
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
void STABH(void *)
Definition: MemObject.h:28
void const char * buf
Definition: stub_helper.cc:16
void Maintain(void *unused)
Definition: store.cc:1177
void storeGetMemSpace(int size)
Definition: store.cc:1163
size_t HttpReply *STUB StoreEntry const KeyScope scope const HttpRequestMethod const KeyScope scope const char const RequestFlags const HttpRequestMethod const char * logUrl
Definition: stub_store.cc:110
void setCollapsingRequirement(const bool required)
allow or forbid collapsed requests feeding
Definition: store.cc:2066
bool makePublic(const KeyScope keyScope=ksDefault)
Definition: store.cc:145
void dump(int debug_lvl) const
Definition: store.cc:1547
const char * getSerialisedMetaData(size_t &length) const
Definition: store.cc:1821
void storeFsInit(void)
Definition: store.cc:1684
Store::Disk & disk() const
the disk this entry is [being] cached on; asserts for entries w/o a disk
Definition: store.cc:1973
static const char * storeId(const int i)
Definition: testRock.cc:177
bool hasIfNoneMatchEtag(const HttpRequest &request) const
has ETag matching at least one of the If-None-Match etags
Definition: store.cc:1933
int checkNegativeHit() const
Definition: store.cc:1346
void swapOutFileClose(int how)
const char * memStatusStr[]
Definition: stub_store.cc:17
bool cacheNegatively()
Definition: store.cc:166
void write(StoreIOBuffer)
Definition: store.cc:804
bool memoryCachable()
checkCachable() and can be cached in memory
Definition: store.cc:1325
bool mayStartSwapOut()
whether we may start writing to disk (now or in the future)
size_t HttpReply *STUB StoreEntry const KeyScope scope const HttpRequestMethod const KeyScope scope const char const RequestFlags const HttpRequestMethod const char const HttpRequestMethod time_t const char STUB void storeAppendVPrintf(StoreEntry *, const char *, va_list ap) STUB int storeTooManyDiskFilesOpen(void) STUB_RETVAL(0) void storeHeapPositionUpdate(StoreEntry *
Definition: store.cc:891
void storeConfigure(void)
Definition: store.cc:1319
bool checkDeferRead(int fd) const
Definition: store.cc:247
KeyScope
Definition: store_key_md5.h:18
StoreEntry * storeCreatePureEntry(const char *url, const char *log_url, const HttpRequestMethod &method)
Definition: store.cc:765
StoreIoStats store_io_stats
Definition: store_io.cc:16
size_t storeEntryInUse() STUB_RETVAL(0) void storeEntryReplaceObject(StoreEntry *
size_t HttpReply *STUB StoreEntry * storeGetPublic(const char *uri, const HttpRequestMethod &method) STUB_RETVAL(NULL) StoreEntry *storeGetPublicByRequest(HttpRequest *request
Definition: store.cc:522
void registerAbort(STABH *cb, void *)
Definition: store.cc:1528
#define STUB_RETREF(x)
Definition: STUB.h:51
void unregisterAbort()
Definition: store.cc:1537
enum _mem_status_t mem_status_t
StoreEntry * storeGetPublicByRequest(HttpRequest *req, const KeyScope keyScope)
Definition: store.cc:534
const char * storeStatusStr[]
Definition: stub_store.cc:15
void storeHeapPositionUpdate(StoreEntry *, SwapDir *)
size_t HttpReply *STUB StoreEntry const KeyScope scope const HttpRequestMethod const KeyScope scope const char const RequestFlags const HttpRequestMethod const char const HttpRequestMethod time_t const char STUB void SwapDir *STUB void storeSwapFileNumberSet(StoreEntry *e, sfileno filn) STUB void storeFsInit(void) STUB void storeFsDone(void) STUB void storeReplAdd(const char *
int expiresMoreThan(time_t expires, time_t when)
Definition: store.cc:1391
bool hasIfMatchEtag(const HttpRequest &request) const
has ETag matching at least one of the If-Match etags
Definition: store.cc:1926
void swapOut()
void reset()
Definition: store.cc:1669
void setPrivateKey(const bool shareable, const bool permanent)
Definition: store.cc:566
FREE destroyStoreEntry
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:881
void negativeCache()
Definition: store.cc:1367
size_t HttpReply *STUB StoreEntry const KeyScope scope STUB_RETVAL(NULL) StoreEntry *storeGetPublicByRequestMethod(HttpRequest *request
#define NULL
Definition: types.h:166
A StoreEntry::getPublic*() caller.
Definition: StoreClient.h:23
int size
Definition: ModDevPoll.cc:77
void trimMemory(const bool preserveSwappable)
Definition: store.cc:1867
size_t bytesWanted(Range< size_t > const aRange, bool ignoreDelayPool=false) const
Definition: store.cc:229
manages a single cache_dir
Definition: Disk.h:21
void setMemStatus(mem_status_t)
Definition: store.cc:1572
void lock(const char *context)
Definition: store.cc:439
void createMemObject()
Definition: store.cc:1623

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors