From: robertc <> Date: Fri, 17 Jan 2003 12:49:34 +0000 (+0000) Subject: make StoreEntry the type for _StoreEntry throughout X-Git-Tag: SQUID_3_0_PRE1~454 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b13a8fd353fd6345f6136c33c51dc62e84be44d;p=thirdparty%2Fsquid.git make StoreEntry the type for _StoreEntry throughout --- diff --git a/src/Store.h b/src/Store.h index e338dd4abc..4fdb9394bf 100644 --- a/src/Store.h +++ b/src/Store.h @@ -1,6 +1,6 @@ /* - * $Id: Store.h,v 1.4 2002/12/27 10:26:33 robertc Exp $ + * $Id: Store.h,v 1.5 2003/01/17 05:49:35 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -38,7 +38,7 @@ class StoreClient; #endif -struct _StoreEntry : public hash_link { +class StoreEntry : public hash_link { public: virtual const char *getMD5Text() const; @@ -77,7 +77,7 @@ private: }; #ifdef __cplusplus -class NullStoreEntry:public _StoreEntry +class NullStoreEntry:public StoreEntry { public: static NullStoreEntry *getInstance(); diff --git a/src/StoreClient.h b/src/StoreClient.h index 06067f0c16..be062c7f36 100644 --- a/src/StoreClient.h +++ b/src/StoreClient.h @@ -1,6 +1,6 @@ /* - * $Id: StoreClient.h,v 1.4 2002/12/27 10:26:33 robertc Exp $ + * $Id: StoreClient.h,v 1.5 2003/01/17 05:49:35 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -39,14 +39,14 @@ typedef void STCB(void *, StoreIOBuffer); /* store callback */ #ifdef __cplusplus -class _StoreEntry; +class StoreEntry; #endif #ifdef __cplusplus class StoreClient { public: virtual ~StoreClient () {} - virtual void created (_StoreEntry *newEntry) = 0; + virtual void created (StoreEntry *newEntry) = 0; }; #endif diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index e4b4964005..b161f989c9 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.29 2003/01/09 12:24:22 robertc Exp $ + * $Id: client_side_reply.cc,v 1.30 2003/01/17 05:49:34 robertc Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -50,14 +50,14 @@ public: void purgeRequest (); void purgeRequestFindObjectToPurge(); void purgeDoMissPurge(); - void purgeFoundGet(_StoreEntry *newEntry); - void purgeFoundHead(_StoreEntry *newEntry); - void purgeFoundObject(_StoreEntry *entry); - void purgeDoPurgeGet(_StoreEntry *entry); - void purgeDoPurgeHead(_StoreEntry *entry); + void purgeFoundGet(StoreEntry *newEntry); + void purgeFoundHead(StoreEntry *newEntry); + void purgeFoundObject(StoreEntry *entry); + void purgeDoPurgeGet(StoreEntry *entry); + void purgeDoPurgeHead(StoreEntry *entry); void doGetMoreData(); void identifyStoreObject(); - void identifyFoundObject(_StoreEntry *entry); + void identifyFoundObject(StoreEntry *entry); int storeOKTransferDone() const; int storeNotOKTransferDone() const; @@ -65,7 +65,7 @@ public: /* state variable - replace with class to handle storeentries at some point */ int lookingforstore; - virtual void created (_StoreEntry *newEntry); + virtual void created (StoreEntry *newEntry); clientHttpRequest *http; int headers_sz; @@ -815,11 +815,11 @@ clientReplyContext::purgeRequestFindObjectToPurge() /* Try to find a base entry */ http->flags.purging = 1; lookingforstore = 1; - _StoreEntry::getPublicByRequestMethod(this, http->request, METHOD_GET); + StoreEntry::getPublicByRequestMethod(this, http->request, METHOD_GET); } void -clientReplyContext::created(_StoreEntry *newEntry) +clientReplyContext::created(StoreEntry *newEntry) { if (lookingforstore == 1) purgeFoundGet(newEntry); @@ -834,17 +834,17 @@ clientReplyContext::created(_StoreEntry *newEntry) } void -clientReplyContext::purgeFoundGet(_StoreEntry *newEntry) +clientReplyContext::purgeFoundGet(StoreEntry *newEntry) { if (newEntry->isNull()) { lookingforstore = 2; - _StoreEntry::getPublicByRequestMethod(this, http->request, METHOD_HEAD); + StoreEntry::getPublicByRequestMethod(this, http->request, METHOD_HEAD); } else purgeFoundObject (newEntry); } void -clientReplyContext::purgeFoundHead(_StoreEntry *newEntry) +clientReplyContext::purgeFoundHead(StoreEntry *newEntry) { if (newEntry->isNull()) purgeDoMissPurge(); @@ -853,7 +853,7 @@ clientReplyContext::purgeFoundHead(_StoreEntry *newEntry) } void -clientReplyContext::purgeFoundObject(_StoreEntry *entry) +clientReplyContext::purgeFoundObject(StoreEntry *entry) { assert (entry && !entry->isNull()); StoreIOBuffer tempBuffer = EMPTYIOBUFFER; @@ -900,11 +900,11 @@ clientReplyContext::purgeDoMissPurge() { http->logType = LOG_TCP_MISS; lookingforstore = 3; - _StoreEntry::getPublicByRequestMethod(this,http->request, METHOD_GET); + StoreEntry::getPublicByRequestMethod(this,http->request, METHOD_GET); } void -clientReplyContext::purgeDoPurgeGet(_StoreEntry *newEntry) +clientReplyContext::purgeDoPurgeGet(StoreEntry *newEntry) { assert (newEntry); /* Move to new() when that is created */ @@ -917,11 +917,11 @@ clientReplyContext::purgeDoPurgeGet(_StoreEntry *newEntry) purgeStatus = HTTP_OK; } lookingforstore = 4; - _StoreEntry::getPublicByRequestMethod(this, http->request, METHOD_HEAD); + StoreEntry::getPublicByRequestMethod(this, http->request, METHOD_HEAD); } void -clientReplyContext::purgeDoPurgeHead(_StoreEntry *newEntry) +clientReplyContext::purgeDoPurgeHead(StoreEntry *newEntry) { if (newEntry) { debug(88, 4) ("clientPurgeRequest: HEAD '%s'\n", storeUrl(newEntry)); @@ -1355,7 +1355,7 @@ clientReplyContext::identifyStoreObject() request_t *r = http->request; if (r->flags.cachable || r->flags.internal) { lookingforstore = 5; - _StoreEntry::getPublicByRequest (this, r); + StoreEntry::getPublicByRequest (this, r); } else identifyFoundObject (NullStoreEntry::getInstance()); } diff --git a/src/htcp.cc b/src/htcp.cc index d45fe8351f..09cc85f23a 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -1,6 +1,6 @@ /* - * $Id: htcp.cc,v 1.48 2003/01/04 01:12:49 hno Exp $ + * $Id: htcp.cc,v 1.49 2003/01/17 05:49:34 robertc Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -95,7 +95,7 @@ public: void *operator new (unsigned int byteCount); void operator delete (void *address); - void created (_StoreEntry *newEntry); + void created (StoreEntry *newEntry); void checkHit(); void checkedHit(StoreEntry *e); void setFrom (struct sockaddr_in *from); @@ -674,11 +674,11 @@ htcpSpecifier::checkHit() checkedHit(NullStoreEntry::getInstance()); return; } - _StoreEntry::getPublicByRequest(this, checkHitRequest); + StoreEntry::getPublicByRequest(this, checkHitRequest); } void -htcpSpecifier::created (_StoreEntry *e) +htcpSpecifier::created (StoreEntry *e) { StoreEntry *hit=NULL; assert (e); diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 22d4b40ee1..5dba7ef93e 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -1,6 +1,6 @@ /* - * $Id: icp_v2.cc,v 1.72 2002/10/21 14:00:02 adrian Exp $ + * $Id: icp_v2.cc,v 1.73 2003/01/17 05:49:34 robertc Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -388,7 +388,7 @@ doV2Query(int fd, struct sockaddr_in from, char *buf, icp_common_t header) state->flags = flags; state->rtt = rtt; state->src_rtt = src_rtt; - _StoreEntry::getPublic (state, url, METHOD_GET); + StoreEntry::getPublic (state, url, METHOD_GET); } void diff --git a/src/icp_v3.cc b/src/icp_v3.cc index 8dcf823552..ba564f010c 100644 --- a/src/icp_v3.cc +++ b/src/icp_v3.cc @@ -1,6 +1,6 @@ /* - * $Id: icp_v3.cc,v 1.35 2002/10/13 20:35:01 robertc Exp $ + * $Id: icp_v3.cc,v 1.36 2003/01/17 05:49:34 robertc Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -63,7 +63,7 @@ doV3Query(int fd, struct sockaddr_in from, char *buf, icp_common_t header) state->fd = fd; state->from = from; state->url = xstrdup (url); - _StoreEntry::getPublic (state, url, METHOD_GET); + StoreEntry::getPublic (state, url, METHOD_GET); } ICP3State::~ICP3State () diff --git a/src/mime.cc b/src/mime.cc index fdab257f17..232aece900 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -1,6 +1,6 @@ /* - * $Id: mime.cc,v 1.108 2002/11/10 04:43:04 hno Exp $ + * $Id: mime.cc,v 1.109 2003/01/17 05:49:34 robertc Exp $ * * DEBUG: section 25 MIME Parsing * AUTHOR: Harvest Derived @@ -46,7 +46,7 @@ public: char const * getName () const; void _free(); void load(); - void created (_StoreEntry *newEntry); + void created (StoreEntry *newEntry); private: char *icon; char *url; @@ -451,7 +451,7 @@ MimeIcon::load() const char *type = mimeGetContentType(icon); if (type == NULL) fatal("Unknown icon format while reading mime.conf\n"); - _StoreEntry::getPublic(this, url, METHOD_GET); + StoreEntry::getPublic(this, url, METHOD_GET); } void diff --git a/src/snmp_agent.cc b/src/snmp_agent.cc index cde0bb15ba..b49e872e7a 100644 --- a/src/snmp_agent.cc +++ b/src/snmp_agent.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_agent.cc,v 1.84 2002/10/13 20:35:03 robertc Exp $ + * $Id: snmp_agent.cc,v 1.85 2003/01/17 05:49:34 robertc Exp $ * * DEBUG: section 49 SNMP Interface * AUTHOR: Kostas Anagnostakis @@ -300,7 +300,7 @@ snmp_prfSysFn(variable_list * Var, snint * ErrP) break; case PERF_SYS_NUMOBJCNT: Answer = snmp_var_new_integer(Var->name, Var->name_length, - (snint) _StoreEntry::inUseCount(), + (snint) StoreEntry::inUseCount(), SMI_COUNTER32); break; default: diff --git a/src/store.cc b/src/store.cc index 05c7ce772e..eac0caf747 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.552 2002/12/27 10:26:33 robertc Exp $ + * $Id: store.cc,v 1.553 2003/01/17 05:49:34 robertc Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -97,12 +97,12 @@ static EVH storeLateRelease; * local variables */ static Stack LateReleaseStack; -MemPool *_StoreEntry::pool = NULL; +MemPool *StoreEntry::pool = NULL; void * -_StoreEntry::operator new (size_t bytecount) +StoreEntry::operator new (size_t bytecount) { - assert (bytecount == sizeof (_StoreEntry)); + assert (bytecount == sizeof (StoreEntry)); if (!pool) { pool = memPoolCreate ("StoreEntry", bytecount); memPoolSetChunkSize(pool, 2048 * 1024); @@ -111,13 +111,13 @@ _StoreEntry::operator new (size_t bytecount) } void -_StoreEntry::operator delete (void *address) +StoreEntry::operator delete (void *address) { memPoolFree(pool, address); } size_t -_StoreEntry::inUseCount() +StoreEntry::inUseCount() { if (!pool) return 0; @@ -127,7 +127,7 @@ _StoreEntry::inUseCount() } const char * -_StoreEntry::getMD5Text() const +StoreEntry::getMD5Text() const { return storeKeyText((const cache_key *)key); } @@ -135,7 +135,7 @@ _StoreEntry::getMD5Text() const size_t storeEntryInUse () { - return _StoreEntry::inUseCount(); + return StoreEntry::inUseCount(); } @@ -175,7 +175,7 @@ StoreEntry * new_StoreEntry(int mem_obj_flag, const char *url, const char *log_url) { StoreEntry *e = NULL; - e = new _StoreEntry; + e = new StoreEntry; if (mem_obj_flag) e->mem_obj = new_MemObject(url, log_url); debug(20, 3) ("new_StoreEntry: returning %p\n", e); @@ -360,10 +360,10 @@ storeGet(const cache_key * key) } void -_StoreEntry::getPublicByRequestMethod (StoreClient *aClient, request_t * request, const method_t method) +StoreEntry::getPublicByRequestMethod (StoreClient *aClient, request_t * request, const method_t method) { assert (aClient); - _StoreEntry *result = storeGetPublicByRequestMethod( request, method); + StoreEntry *result = storeGetPublicByRequestMethod( request, method); if (!result) aClient->created (NullStoreEntry::getInstance()); else @@ -371,20 +371,20 @@ _StoreEntry::getPublicByRequestMethod (StoreClient *aClient, request_t * reques } void -_StoreEntry::getPublicByRequest (StoreClient *aClient, request_t * request) +StoreEntry::getPublicByRequest (StoreClient *aClient, request_t * request) { assert (aClient); - _StoreEntry *result = storeGetPublicByRequest (request); + StoreEntry *result = storeGetPublicByRequest (request); if (!result) result = NullStoreEntry::getInstance(); aClient->created (result); } void -_StoreEntry::getPublic (StoreClient *aClient, const char *uri, const method_t method) +StoreEntry::getPublic (StoreClient *aClient, const char *uri, const method_t method) { assert (aClient); - _StoreEntry *result = storeGetPublic (uri, method); + StoreEntry *result = storeGetPublic (uri, method); if (!result) result = NullStoreEntry::getInstance(); aClient->created (result); diff --git a/src/typedefs.h b/src/typedefs.h index c68b5e7403..501df6bb13 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.144 2002/12/27 10:26:34 robertc Exp $ + * $Id: typedefs.h,v 1.145 2003/01/17 05:49:35 robertc Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -136,7 +136,7 @@ typedef struct _mem_node mem_node; typedef struct _mem_hdr mem_hdr; typedef struct _store_client store_client; typedef struct _MemObject MemObject; -typedef struct _StoreEntry StoreEntry; +class StoreEntry; class SwapDir; typedef struct _helper_flags helper_flags; typedef struct _helper_stateful_flags helper_stateful_flags; diff --git a/src/urn.cc b/src/urn.cc index 02e4acb116..bd0f37e40e 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -1,6 +1,6 @@ /* - * $Id: urn.cc,v 1.79 2002/10/25 07:36:32 robertc Exp $ + * $Id: urn.cc,v 1.80 2003/01/17 05:49:35 robertc Exp $ * * DEBUG: section 52 URN Parsing * AUTHOR: Kostas Anagnostakis @@ -41,7 +41,7 @@ class UrnState : public StoreClient { public: - void created (_StoreEntry *newEntry); + void created (StoreEntry *newEntry); void *operator new (size_t byteCount); void operator delete (void *address); void start (request_t *, StoreEntry *); @@ -211,11 +211,11 @@ UrnState::start(request_t * r, StoreEntry * e) setUriResFromRequest(r); if (urlres_r == NULL) return; - _StoreEntry::getPublic (this, urlres, METHOD_GET); + StoreEntry::getPublic (this, urlres, METHOD_GET); } void -UrnState::created(_StoreEntry *newEntry) +UrnState::created(StoreEntry *newEntry) { urlres_e = newEntry; if (urlres_e->isNull()) {