stub_store.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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)
27 StoreEntry::StoreEntry() STUB
28 StoreEntry::~StoreEntry() STUB
29 HttpReply const *StoreEntry::getReply() const STUB_RETVAL(NULL)
30 void StoreEntry::write(StoreIOBuffer) STUB
31 bool StoreEntry::isAccepting() const STUB_RETVAL(false)
32 size_t StoreEntry::bytesWanted(Range<size_t> const, bool) const STUB_RETVAL(0)
33 void StoreEntry::complete() STUB
35 char const *StoreEntry::getSerialisedMetaData() STUB_RETVAL(NULL)
36 void StoreEntry::replaceHttpReply(HttpReply *, bool andStartWriting) STUB
37 bool StoreEntry::mayStartSwapOut() STUB_RETVAL(false)
38 void StoreEntry::trimMemory(const bool preserveSwappable) STUB
39 void StoreEntry::abort() STUB
40 void StoreEntry::makePublic(const KeyScope scope) STUB
41 void StoreEntry::makePrivate(const bool shareable) STUB
42 void StoreEntry::setPublicKey(const KeyScope scope) STUB
43 void StoreEntry::setPrivateKey(const bool shareable) STUB
44 void StoreEntry::expireNow() STUB
45 void StoreEntry::releaseRequest(const bool shareable) STUB
46 void StoreEntry::negativeCache() STUB
47 void StoreEntry::cacheNegatively() STUB
48 void StoreEntry::purgeMem() STUB
49 void StoreEntry::swapOut() STUB
50 void StoreEntry::swapOutFileClose(int how) STUB
51 const char *StoreEntry::url() const STUB_RETVAL(NULL)
52 bool StoreEntry::checkCachable() STUB_RETVAL(false)
53 int StoreEntry::checkNegativeHit() const STUB_RETVAL(0)
54 int StoreEntry::locked() const STUB_RETVAL(0)
55 int StoreEntry::validToSend() const STUB_RETVAL(0)
56 bool StoreEntry::memoryCachable() STUB_RETVAL(false)
57 void StoreEntry::createMemObject() STUB
58 void StoreEntry::createMemObject(const char *, const char *, const HttpRequestMethod &aMethod) STUB
59 void StoreEntry::ensureMemObject(const char *, const char *, const HttpRequestMethod &) STUB
60 void StoreEntry::dump(int debug_lvl) const STUB
61 void StoreEntry::hashDelete() STUB
62 void StoreEntry::hashInsert(const cache_key *) STUB
63 void StoreEntry::registerAbort(STABH * cb, void *) STUB
64 void StoreEntry::reset() STUB
65 void StoreEntry::setMemStatus(mem_status_t) STUB
66 bool StoreEntry::timestampsSet() STUB_RETVAL(false)
67 void StoreEntry::unregisterAbort() STUB
68 void StoreEntry::destroyMemObject() STUB
69 int StoreEntry::checkTooSmall() STUB_RETVAL(0)
70 void StoreEntry::delayAwareRead(const Comm::ConnectionPointer&, char *buf, int len, AsyncCall::Pointer callback) STUB
71 void StoreEntry::setNoDelay (bool const) STUB
72 bool StoreEntry::modifiedSince(const time_t, const int) const STUB_RETVAL(false)
73 bool StoreEntry::hasIfMatchEtag(const HttpRequest &request) const STUB_RETVAL(false)
74 bool StoreEntry::hasIfNoneMatchEtag(const HttpRequest &request) const STUB_RETVAL(false)
75 Store::Disk &StoreEntry::disk() const STUB_RETREF(Store::Disk)
76 size_t StoreEntry::inUseCount() STUB_RETVAL(0)
77 void StoreEntry::getPublicByRequestMethod(StoreClient * aClient, HttpRequest * request, const HttpRequestMethod& method) STUB
78 void StoreEntry::getPublicByRequest(StoreClient * aClient, HttpRequest * request) STUB
79 void StoreEntry::getPublic(StoreClient * aClient, const char *uri, const HttpRequestMethod& method) STUB
80 void *StoreEntry::operator new(size_t byteCount)
81 {
82  STUB
83  return new StoreEntry();
84 }
85 void StoreEntry::operator delete(void *address) STUB
87 //#if USE_SQUID_ESI
88 //ESIElement::Pointer StoreEntry::cachedESITree STUB_RETVAL(NULL)
89 //#endif
90 void StoreEntry::buffer() STUB
91 void StoreEntry::flush() STUB
92 int StoreEntry::unlock(const char *) STUB_RETVAL(0)
93 int64_t StoreEntry::objectLen() const STUB_RETVAL(0)
94 int64_t StoreEntry::contentLen() const STUB_RETVAL(0)
95 void StoreEntry::lock(const char *) STUB
96 void StoreEntry::touch() STUB
97 void StoreEntry::release(const bool shareable) STUB
98 void StoreEntry::append(char const *, int) STUB
99 void StoreEntry::vappendf(const char *, va_list) STUB
100 
102 const char *NullStoreEntry::getMD5Text() const STUB_RETVAL(NULL)
103 void NullStoreEntry::operator delete(void *address) STUB
104 // private virtual. Why is this linked from outside?
106 
107 Store::Controller &Store::Root() STUB_RETREF(Store::Controller)
108 void Store::Init(Store::Controller *root) STUB
109 void Store::FreeMemory() STUB
110 void Store::Stats(StoreEntry * output) STUB
111 void Store::Maintain(void *unused) STUB
112 int Store::Controller::store_dirs_rebuilding = 0;
113 StoreSearch *Store::Controller::search() STUB_RETVAL(NULL)
114 void Store::Controller::maintain() STUB
115 
116 std::ostream &operator <<(std::ostream &os, const StoreEntry &)
117 {
118  STUB
119  return os;
120 }
121 
122 size_t storeEntryInUse() STUB_RETVAL(0)
123 void storeEntryReplaceObject(StoreEntry *, HttpReply *) STUB
124 StoreEntry *storeGetPublic(const char *uri, const HttpRequestMethod& method) STUB_RETVAL(NULL)
125 StoreEntry *storeGetPublicByRequest(HttpRequest * request, const KeyScope scope) STUB_RETVAL(NULL)
126 StoreEntry *storeGetPublicByRequestMethod(HttpRequest * request, const HttpRequestMethod& method, const KeyScope scope) STUB_RETVAL(NULL)
127 StoreEntry *storeCreateEntry(const char *, const char *, const RequestFlags &, const HttpRequestMethod&) STUB_RETVAL(NULL)
128 StoreEntry *storeCreatePureEntry(const char *storeId, const char *logUrl, const RequestFlags &, const HttpRequestMethod&) STUB_RETVAL(NULL)
129 void storeConfigure(void) STUB
130 int expiresMoreThan(time_t, time_t) STUB_RETVAL(0)
131 void storeAppendPrintf(StoreEntry *, const char *,...) STUB
132 void storeAppendVPrintf(StoreEntry *, const char *, va_list ap) STUB
134 void storeHeapPositionUpdate(StoreEntry *, SwapDir *) STUB
135 void storeSwapFileNumberSet(StoreEntry * e, sfileno filn) STUB
136 void storeFsInit(void) STUB
137 void storeFsDone(void) STUB
138 void storeReplAdd(const char *, REMOVALPOLICYCREATE *) STUB
139 void destroyStoreEntry(void *) STUB
140 void storeGetMemSpace(int size) STUB
141 
void storeReplAdd(const char *type, REMOVALPOLICYCREATE *create)
Definition: store.cc:1773
virtual bool isAccepting() const
Definition: store.cc:2068
void makePrivate(const bool shareable)
Definition: store.cc:150
void const char HLPCB * callback
Definition: stub_helper.cc:16
void touch()
update last reference timestamp and related Store metadata
Definition: store.cc:455
static void getPublicByRequestMethod(StoreClient *aClient, HttpRequest *request, const HttpRequestMethod &method)
Definition: store.cc:513
void Stats(StoreEntry *)
Definition: old_api.cc:171
int validToSend() const
Definition: store.cc:1485
virtual void release(const bool shareable=false)
Definition: store.cc:1250
int unlock(const char *context)
Definition: store.cc:485
size_t HttpReply *STUB StoreEntry const KeyScope scope const HttpRequestMethod const KeyScope scope const char const RequestFlags const HttpRequestMethod const char const RequestFlags 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 *
virtual int64_t contentLen() const
Definition: store.cc:1734
void storeEntryReplaceObject(StoreEntry *, HttpReply *)
bool timestampsSet()
Definition: store.cc:1525
virtual void append(char const *, int)
Appends a c-string to existing packed data.
Definition: store.cc:844
unsigned char cache_key
Store key.
Definition: forward.h:29
void makePublic(const KeyScope keyScope=ksDefault)
Definition: store.cc:142
void setPublicKey(const KeyScope keyScope=ksDefault)
Definition: store.cc:623
virtual void buffer()
Definition: store.cc:1707
void expireNow()
Definition: store.cc:815
static size_t inUseCount()
Definition: store.cc:173
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:1695
Definition: Range.h:18
virtual void flush()
Definition: store.cc:1718
StoreEntry * storeGetPublicByRequestMethod(HttpRequest *req, const HttpRequestMethod &method, const KeyScope keyScope)
Definition: store.cc:555
void delayAwareRead(const Comm::ConnectionPointer &conn, char *buf, int len, AsyncCall::Pointer callback)
Definition: store.cc:199
void storeFsDone(void)
const char * pingStatusStr[]
Definition: stub_store.cc:16
Controller & Root()
safely access controller singleton
Definition: Controller.cc:619
int storeTooManyDiskFilesOpen(void)
Definition: store.cc:940
void destroyMemObject()
Definition: store.cc:370
void replaceHttpReply(HttpReply *, bool andStartWriting=true)
Definition: store.cc:1854
void setReleaseFlag()
Definition: store.cc:461
static void getPublicByRequest(StoreClient *aClient, HttpRequest *request)
Definition: store.cc:525
RemovalPolicy * REMOVALPOLICYCREATE(wordlist *args)
Definition: RemovalPolicy.h:80
bool hasIfMatchEtag(const HttpRequest &request) const
has ETag matching at least one of the If-Match etags
Definition: store.cc:2008
virtual void complete()
Definition: store.cc:1088
void purgeMem()
Definition: store.cc:434
static void getPublic(StoreClient *aClient, const char *uri, const HttpRequestMethod &method)
Definition: store.cc:537
virtual char const * getSerialisedMetaData()
Definition: store.cc:1892
const char * swapStatusStr[]
Definition: stub_store.cc:18
void hashDelete()
Definition: store.cc:421
int locked() const
Definition: store.cc:1320
StoreEntry * storeCreatePureEntry(const char *url, const char *log_url, const RequestFlags &flags, const HttpRequestMethod &method)
Definition: store.cc:776
void hashInsert(const cache_key *)
Definition: store.cc:413
bool checkDeferRead(int fd) const
Definition: store.cc:244
store_client_t
Definition: enums.h:56
StoreEntry()
Definition: store.cc:322
virtual int64_t objectLen() const
Definition: store.cc:1727
StoreEntry * storeCreateEntry(const char *url, const char *logUrl, const RequestFlags &flags, const HttpRequestMethod &method)
Definition: store.cc:800
void abort()
Definition: store.cc:1134
bool checkCachable()
Definition: store.cc:981
virtual HttpReply const * getReply() const
Definition: store.cc:1742
RemovalPolicy * createRemovalPolicy(RemovalPolicySettings *settings) STUB_RETVAL(NULL) StoreIoStats store_io_stats
Definition: store.cc:1799
#define STUB
macro to stub a void function.
Definition: STUB.h:33
bool modifiedSince(const time_t ims, const int imslen=-1) const
Definition: store.cc:1960
void Init(void)
prepares to parse ACLs configuration
Definition: AclRegs.cc:111
void dump(int debug_lvl) const
Definition: store.cc:1605
int checkNegativeHit() const
Definition: store.cc:1431
Store statistics related to low-level I/O.
Definition: StoreStats.h:58
void releaseRequest(const bool shareable=false)
Definition: store.cc:474
virtual void vappendf(const char *, va_list)
Definition: store.cc:862
RefCount< Comm::Connection > ConnectionPointer
Definition: forward.h:25
void setNoDelay(bool const)
Definition: store.cc:250
signed_int32_t sfileno
Definition: forward.h:22
int checkTooSmall()
Definition: store.cc:952
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
const char * url() const
Definition: store.cc:1672
void STABH(void *)
Definition: MemObject.h:27
void const char * buf
Definition: stub_helper.cc:16
void Maintain(void *unused)
Definition: store.cc:1235
void storeGetMemSpace(int size)
Definition: store.cc:1185
void cacheNegatively()
Definition: store.cc:165
void storeFsInit(void)
Definition: store.cc:1764
virtual const char * getMD5Text() const
Definition: store.cc:181
void swapOutFileClose(int how)
const char * memStatusStr[]
Definition: stub_store.cc:17
virtual void write(StoreIOBuffer)
Definition: store.cc:822
Store::Disk & disk() const
the disk this entry is [being] cached on; asserts for entries w/o a disk
Definition: store.cc:2055
void FreeMemory()
undo Init()
Definition: Controller.cc:632
bool memoryCachable()
checkCachable() and can be cached in memory
Definition: store.cc:1410
virtual bool mayStartSwapOut()
whether we may start writing to disk (now or in the future)
void storeConfigure(void)
Definition: store.cc:1404
KeyScope
Definition: store_key_md5.h:18
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:549
void registerAbort(STABH *cb, void *)
Definition: store.cc:1586
virtual size_t bytesWanted(Range< size_t > const aRange, bool ignoreDelayPool=false) const
Definition: store.cc:226
#define STUB_RETREF(x)
Definition: STUB.h:51
void setPrivateKey(const bool shareable)
Definition: store.cc:593
bool hasIfNoneMatchEtag(const HttpRequest &request) const
has ETag matching at least one of the If-None-Match etags
Definition: store.cc:2015
void unregisterAbort()
Definition: store.cc:1595
enum _mem_status_t mem_status_t
StoreEntry * storeGetPublicByRequest(HttpRequest *req, const KeyScope keyScope)
Definition: store.cc:561
virtual store_client_t storeClientType() const
Definition: store.cc:262
const char * storeStatusStr[]
Definition: stub_store.cc:15
void storeHeapPositionUpdate(StoreEntry *, SwapDir *)
int expiresMoreThan(time_t expires, time_t when)
Definition: store.cc:1476
void swapOut()
void reset()
Definition: store.cc:1748
size_t HttpReply *STUB StoreEntry const KeyScope scope STUB_RETVAL(NULL) StoreEntry *storeGetPublicByRequestMethod(HttpRequest *request
FREE destroyStoreEntry
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
Definition: store.cc:904
void negativeCache()
Definition: store.cc:1452
#define NULL
Definition: types.h:166
int size
Definition: ModDevPoll.cc:77
virtual void trimMemory(const bool preserveSwappable)
Definition: store.cc:1938
#define false
Definition: GnuRegex.c:233
size_t HttpReply *STUB StoreEntry const KeyScope scope const HttpRequestMethod const KeyScope scope const char const RequestFlags const HttpRequestMethod const char const RequestFlags 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:914
manages a single cache_dir
Definition: Disk.h:21
void setMemStatus(mem_status_t)
Definition: store.cc:1630
void lock(const char *context)
Definition: store.cc:448
void createMemObject()
Definition: store.cc:1681

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors