From: Amos Jeffries Date: Sat, 27 Nov 2010 06:44:33 +0000 (-0700) Subject: Policy: use USE_* from code wrappers and ENABLE_* for conditionals. X-Git-Tag: take1~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a0a18dedf70390ae43a9302d4096663475c8ff6;p=thirdparty%2Fsquid.git Policy: use USE_* from code wrappers and ENABLE_* for conditionals. Makes a few more of the build conditionals match our naming policy. http://wiki.squid-cache.org/Squid3CodingGuidelines Updates two code wrapper macros: * CBDATA_DEBUG becomes USE_CBDATA_DEBUG * DELAY_POOLS becomes USE_DELAY_POOLS Updates USE_DELAY_POOLS automake conditional to ENABLE_DELAY_POOLS TODO: There are more of these wrappers to be updated. --- diff --git a/configure.in b/configure.in index 2229784b52..d557f397b0 100644 --- a/configure.in +++ b/configure.in @@ -353,7 +353,7 @@ AC_ARG_ENABLE(debug-cbdata, SQUID_YESNO([$enableval], [unrecognized argument to --enable-debug-cbdata: $enableval]) ]) -SQUID_DEFINE_BOOL(CBDATA_DEBUG,${enable_debug_cbdata:=no}, +SQUID_DEFINE_BOOL(USE_CBDATA_DEBUG,${enable_debug_cbdata:=no}, [Enable support for cbdata debug information]) AC_MSG_NOTICE([cbdata debugging enabled: $enable_debug_cbdata]) @@ -770,13 +770,13 @@ AC_ARG_ENABLE(icmp, fi ]) -AM_CONDITIONAL(USE_DELAY_POOLS, false) +AM_CONDITIONAL(ENABLE_DELAY_POOLS, false) AC_ARG_ENABLE(delay-pools, AS_HELP_STRING([--enable-delay-pools],[Enable delay pools to limit bandwidth usage]), [ if test "x$enableval" = "xyes" ; then AC_MSG_NOTICE([Delay pools enabled]) - AC_DEFINE([DELAY_POOLS],1,[Traffic management via "delay pools".]) - AM_CONDITIONAL(USE_DELAY_POOLS, true,) + AC_DEFINE([USE_DELAY_POOLS],1,[Traffic management via "delay pools".]) + AM_CONDITIONAL(ENABLE_DELAY_POOLS, true,) fi ]) diff --git a/squid3.dox b/squid3.dox index 0644a65ff6..91b0b26c21 100644 --- a/squid3.dox +++ b/squid3.dox @@ -1256,7 +1256,6 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = __cplusplus \ USE_HTTP_VIOLATIONS \ WITH_VALGRIND \ - DELAY_POOLS \ ICAP_CLIENT \ FORW_VIA_DB \ SQUID_SNMP \ @@ -1265,6 +1264,7 @@ PREDEFINED = __cplusplus \ USE_ASYNC_IO \ USE_CACHE_DIGESTS \ USE_CLASSFUL \ + USE_DELAY_POOLS \ USE_DLMALLOC \ USE_DNSSERVERS \ USE_EPOLL \ diff --git a/src/ClientInfo.h b/src/ClientInfo.h index f95fa55e7b..7201bf8347 100644 --- a/src/ClientInfo.h +++ b/src/ClientInfo.h @@ -8,7 +8,7 @@ #include "cbdata.h" #include -#if DELAY_POOLS +#if USE_DELAY_POOLS class CommQuotaQueue; #endif @@ -34,7 +34,7 @@ public: } cutoff; int n_established; /* number of current established connections */ time_t last_seen; -#if DELAY_POOLS +#if USE_DELAY_POOLS double writeSpeedLimit;///< Write speed limit in bytes per second, can be less than 1, if too close to zero this could result in timeouts from client double prevTime; ///< previous time when we checked double bucketSize; ///< how much can be written now @@ -72,10 +72,10 @@ public: * \param highWatermark is maximum bucket value */ void setWriteLimiter(const int aWriteSpeedLimit, const double anInitialBurst, const double aHighWatermark); -#endif +#endif /* USE_DELAY_POOLS */ }; -#if DELAY_POOLS +#if USE_DELAY_POOLS // a queue of Comm clients waiting for I/O quota controlled by delay pools class CommQuotaQueue { @@ -102,6 +102,6 @@ private: CBDATA_CLASS2(CommQuotaQueue); }; -#endif /* DELAY_POOLS */ +#endif /* USE_DELAY_POOLS */ #endif diff --git a/src/CommonPool.h b/src/CommonPool.h index 8154578587..c18c85beb6 100644 --- a/src/CommonPool.h +++ b/src/CommonPool.h @@ -37,7 +37,8 @@ */ #ifndef COMMONPOOL_H #define COMMONPOOL_H -#if DELAY_POOLS + +#if USE_DELAY_POOLS #include "squid.h" #include "SquidString.h" #include "CompositePoolNode.h" @@ -63,6 +64,6 @@ protected: String typeLabel; }; -#endif +#endif /* USE_DELAY_POOLS */ #endif /* COMMONPOOL_H */ diff --git a/src/CompositePoolNode.h b/src/CompositePoolNode.h index 89ad43b189..70c46dc59b 100644 --- a/src/CompositePoolNode.h +++ b/src/CompositePoolNode.h @@ -36,7 +36,7 @@ #ifndef COMPOSITEPOOLNODE_H #define COMPOSITEPOOLNODE_H -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "auth/UserRequest.h" #include "DelayPools.h" @@ -82,5 +82,5 @@ protected: DeferredReadManager deferredReads; }; -#endif /* DELAY_POOLS */ +#endif /* USE_DELAY_POOLS */ #endif /* COMPOSITEPOOLNODE_H */ diff --git a/src/DelayBucket.cc b/src/DelayBucket.cc index 1651ff0230..c7722c86da 100644 --- a/src/DelayBucket.cc +++ b/src/DelayBucket.cc @@ -38,30 +38,12 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "DelayBucket.h" #include "DelaySpec.h" #include "Store.h" -#if DEAD_CODE // ? -#include "DelayPools.h" -#include "StoreClient.h" -#include "MemObject.h" -#include "client_side_request.h" -#include "acl/Checklist.h" -#include "acl/Acl.h" -#include "ConfigParser.h" -#include "DelayId.h" -#include "Array.h" -#include "String.h" -#include "CommonPool.h" -#include "CompositePoolNode.h" -#include "DelayPool.h" -#include "DelayVector.h" -#include "NullDelayId.h" -#endif - void DelayBucket::stats(StoreEntry *entry)const { @@ -96,4 +78,4 @@ DelayBucket::init(DelaySpec const &rate) Config.Delay.initial) / 100); } -#endif +#endif /* USE_DELAY_POOLS */ diff --git a/src/DelayConfig.cc b/src/DelayConfig.cc index fe2aefca56..3ad5a118ea 100644 --- a/src/DelayConfig.cc +++ b/src/DelayConfig.cc @@ -39,7 +39,7 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "DelayConfig.h" #include "ConfigParser.h" @@ -142,4 +142,4 @@ DelayConfig::dumpPoolCount(StoreEntry * entry, const char *name) const DelayPools::delay_data[i].dump (entry, i); } -#endif +#endif /* USE_DELAY_POOLS */ diff --git a/src/DelayId.cc b/src/DelayId.cc index 8337f37a59..dcfad8930b 100644 --- a/src/DelayId.cc +++ b/src/DelayId.cc @@ -42,7 +42,7 @@ /* MS Visual Studio Projects are monolithic, so we need the following * #if to exclude the delay pools code from compile process when not needed. */ -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "DelayId.h" @@ -196,4 +196,4 @@ DelayId::delayRead(DeferredRead const &aRead) } -#endif /* DELAY_POOLS */ +#endif /* USE_DELAY_POOLS */ diff --git a/src/DelayId.h b/src/DelayId.h index 1afca60fc3..975fb66d60 100644 --- a/src/DelayId.h +++ b/src/DelayId.h @@ -35,7 +35,7 @@ #ifndef SQUID_DELAYID_H #define SQUID_DELAYID_H -#if DELAY_POOLS +#if USE_DELAY_POOLS class ClientHttpRequest; #include "DelayIdComposite.h" @@ -66,5 +66,5 @@ private: bool markedAsNoDelay; }; -#endif /* DELAY_POOLS */ +#endif /* USE_DELAY_POOLS */ #endif /* SQUID_DELAYID_H */ diff --git a/src/DelayIdComposite.h b/src/DelayIdComposite.h index 9f87e575cd..34138ccbe6 100644 --- a/src/DelayIdComposite.h +++ b/src/DelayIdComposite.h @@ -38,7 +38,8 @@ */ #ifndef DELAYIDCOMPOSITE_H #define DELAYIDCOMPOSITE_H -#if DELAY_POOLS + +#if USE_DELAY_POOLS #include "squid.h" #include "RefCount.h" @@ -57,5 +58,5 @@ public: virtual void delayRead(DeferredRead const &) {fatal("Not implemented");} }; -#endif +#endif /* USE_DELAY_POOLS */ #endif /* DELAYIDCOMPOSITE_H */ diff --git a/src/DelayPool.cc b/src/DelayPool.cc index d6666c92ff..b4871ecc09 100644 --- a/src/DelayPool.cc +++ b/src/DelayPool.cc @@ -38,7 +38,7 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPool.h" #include "CommonPool.h" #include "acl/Acl.h" @@ -118,4 +118,4 @@ CompositePoolNode::kickReads() deferredReads.kickReads(-1); } -#endif +#endif /* USE_DELAY_POOLS */ diff --git a/src/DelayPool.h b/src/DelayPool.h index 815ef32dca..22d2d73dbf 100644 --- a/src/DelayPool.h +++ b/src/DelayPool.h @@ -39,7 +39,7 @@ #ifndef DELAYPOOL_H #define DELAYPOOL_H -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "CompositePoolNode.h" @@ -71,5 +71,5 @@ private: CompositePoolNode::Pointer theComposite_; }; -#endif +#endif /* USE_DELAY_POOLS */ #endif /* DELAYPOOL_H */ diff --git a/src/DelaySpec.cc b/src/DelaySpec.cc index 2718eb23ab..485cdc34e5 100644 --- a/src/DelaySpec.cc +++ b/src/DelaySpec.cc @@ -39,7 +39,7 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "DelaySpec.h" #include "Store.h" diff --git a/src/DelayTagged.cc b/src/DelayTagged.cc index 1f0d3151b7..a29b749364 100644 --- a/src/DelayTagged.cc +++ b/src/DelayTagged.cc @@ -37,7 +37,7 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "DelayTagged.h" #include "NullDelayId.h" diff --git a/src/DelayTagged.h b/src/DelayTagged.h index ad2ed7aa7c..6bc7ec6439 100644 --- a/src/DelayTagged.h +++ b/src/DelayTagged.h @@ -36,7 +36,7 @@ #ifndef DELAYTAGGED_H #define DELAYTAGGED_H -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "auth/Gadgets.h" @@ -106,5 +106,5 @@ private: Splay buckets; }; -#endif /* DELAY_POOLS */ +#endif /* USE_DELAY_POOLS */ #endif /* DELAYTAGGED_H */ diff --git a/src/DelayUser.cc b/src/DelayUser.cc index 7e6e42cc62..24c20dc2d4 100644 --- a/src/DelayUser.cc +++ b/src/DelayUser.cc @@ -37,7 +37,7 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "DelayUser.h" #include "auth/UserRequest.h" diff --git a/src/DelayUser.h b/src/DelayUser.h index 6f37fa2618..9fb36f34ea 100644 --- a/src/DelayUser.h +++ b/src/DelayUser.h @@ -36,7 +36,7 @@ #ifndef DELAYUSER_H #define DELAYUSER_H -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "auth/Gadgets.h" @@ -106,5 +106,5 @@ private: Splay buckets; }; -#endif /* DELAY_POOLS */ +#endif /* USE_DELAY_POOLS */ #endif /* DELAYUSER_H */ diff --git a/src/DelayVector.cc b/src/DelayVector.cc index 367cb75d51..eef4ee6303 100644 --- a/src/DelayVector.cc +++ b/src/DelayVector.cc @@ -39,7 +39,7 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "DelayVector.h" #include "CommRead.h" diff --git a/src/DelayVector.h b/src/DelayVector.h index 7f1002dbe0..a693754cfc 100644 --- a/src/DelayVector.h +++ b/src/DelayVector.h @@ -34,7 +34,7 @@ #ifndef SQUID_DELAYVECTOR_H #define SQUID_DELAYVECTOR_H -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "CompositePoolNode.h" @@ -86,5 +86,5 @@ private: typedef Vector::const_iterator const_iterator; }; -#endif /* DELAY_POOLS */ +#endif /* USE_DELAY_POOLS */ #endif /* SQUID_DELAYVECTOR_H */ diff --git a/src/Makefile.am b/src/Makefile.am index 00d06638ee..1402f4f106 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -93,7 +93,7 @@ DELAY_POOL_ALL_SOURCE = \ ClientDelayConfig.cc \ ClientDelayConfig.h -if USE_DELAY_POOLS +if ENABLE_DELAY_POOLS DELAY_POOL_SOURCE = $(DELAY_POOL_ALL_SOURCE) else DELAY_POOL_SOURCE = diff --git a/src/MemObject.cc b/src/MemObject.cc index 815bf9bbee..1f93fe93cb 100644 --- a/src/MemObject.cc +++ b/src/MemObject.cc @@ -40,7 +40,7 @@ #include "Store.h" #include "StoreClient.h" #include "Generic.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPools.h" #endif #include "MemBuf.h" @@ -377,7 +377,7 @@ MemObject::isContiguous() const int MemObject::mostBytesWanted(int max) const { -#if DELAY_POOLS +#if USE_DELAY_POOLS /* identify delay id with largest allowance */ DelayId largestAllowance = mostBytesAllowed (); return largestAllowance.bytesWanted(0, max); @@ -390,7 +390,7 @@ MemObject::mostBytesWanted(int max) const void MemObject::setNoDelay(bool const newValue) { -#if DELAY_POOLS +#if USE_DELAY_POOLS for (dlink_node *node = clients.head; node; node = node->next) { store_client *sc = (store_client *) node->data; @@ -412,7 +412,7 @@ MemObject::kickReads() deferredReads.kickReads(-1); } -#if DELAY_POOLS +#if USE_DELAY_POOLS DelayId MemObject::mostBytesAllowed() const { diff --git a/src/MemObject.h b/src/MemObject.h index 3631db6d56..74cd99442a 100644 --- a/src/MemObject.h +++ b/src/MemObject.h @@ -43,7 +43,7 @@ typedef void STMCB (void *data, StoreIOBuffer wroteBuffer); class store_client; -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayId.h" #endif @@ -79,8 +79,7 @@ public: bool isContiguous() const; int mostBytesWanted(int max) const; void setNoDelay(bool const newValue); -#if DELAY_POOLS - +#if USE_DELAY_POOLS DelayId mostBytesAllowed() const; #endif diff --git a/src/NullDelayId.cc b/src/NullDelayId.cc index 8df67481f1..87c22e688e 100644 --- a/src/NullDelayId.cc +++ b/src/NullDelayId.cc @@ -39,7 +39,7 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "NullDelayId.h" #include "DelayPools.h" @@ -58,5 +58,4 @@ NullDelayId::operator delete (void *address) ::operator delete (address); } -#endif - +#endif /* USE_DELAY_POOLS */ diff --git a/src/NullDelayId.h b/src/NullDelayId.h index f52c7ec165..6efc3fae62 100644 --- a/src/NullDelayId.h +++ b/src/NullDelayId.h @@ -38,7 +38,7 @@ */ #ifndef NULLDELAYID_H #define NULLDELAYID_H -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "RefCount.h" #include "DelayIdComposite.h" diff --git a/src/StoreClient.h b/src/StoreClient.h index 4d6429dfbb..db1aee6110 100644 --- a/src/StoreClient.h +++ b/src/StoreClient.h @@ -50,7 +50,7 @@ public: virtual void created (StoreEntry *newEntry) = 0; }; -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayId.h" #endif @@ -88,8 +88,8 @@ public: unsigned int store_copying:1; unsigned int copy_event_pending:1; } flags; -#if DELAY_POOLS +#if USE_DELAY_POOLS DelayId delayId; void setDelayId(DelayId delay_id); #endif diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 4f51f752dc..77c2771262 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1555,7 +1555,7 @@ free_acl_b_size_t(acl_size_t ** head) } } -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPools.h" #include "DelayConfig.h" @@ -1607,7 +1607,7 @@ parse_delay_pool_access(DelayConfig * cfg) #endif -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "ClientDelayConfig.h" /* do nothing - free_client_delay_pool_count is the magic free function. * this is why client_delay_pool_count isn't just marked TYPE: ushort @@ -2216,12 +2216,12 @@ parse_peer(peer ** head) p->options.sourcehash = 1; -#if DELAY_POOLS - } else if (!strcasecmp(token, "no-delay")) { +#if USE_DELAY_POOLS p->options.no_delay = 1; +#else + debugs(0, DBG_CRITICAL, "WARNING: cache_peer option 'no-delay' requires --enable-delay-pools"); #endif - } else if (!strncasecmp(token, "login=", 6)) { p->login = xstrdup(token + 6); rfc1738_unescape(p->login); diff --git a/src/cbdata.cc b/src/cbdata.cc index c6cc67f5c2..72c0617b98 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -52,7 +52,7 @@ #include "cbdata.h" #include "mgr/Registration.h" #include "Store.h" -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG #include "Stack.h" #endif #include "Generic.h" @@ -62,11 +62,11 @@ #endif static int cbdataCount = 0; -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG dlink_list cbdataEntries; #endif -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG class CBDataCall { @@ -94,7 +94,7 @@ public: hash_link hash; // Must be first #endif -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG void dump(StoreEntry *)const; #endif @@ -110,7 +110,7 @@ public: int valid; int locks; cbdata_type type; -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG void addHistory(char const *label, char const *aFile, int aLine) { if (calls.size() > 1000) @@ -174,7 +174,7 @@ MEMPROXY_CLASS_INLINE(cbdata); #endif static OBJH cbdataDump; -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG static OBJH cbdataDumpHistory; #endif @@ -207,7 +207,7 @@ cbdata_hash(const void *p, unsigned int mod) cbdata::~cbdata() { -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG CBDataCall *aCall; while ((aCall = calls.pop())) @@ -275,7 +275,7 @@ cbdataRegisterWithCacheManager(void) Mgr::RegisterAction("cbdata", "Callback Data Registry Contents", cbdataDump, 0, 1); -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG Mgr::RegisterAction("cbdatahistory", "Detailed call history for all current cbdata contents", @@ -284,7 +284,7 @@ cbdataRegisterWithCacheManager(void) } void * -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG cbdataInternalAllocDbg(cbdata_type type, const char *file, int line) #else cbdataInternalAlloc(cbdata_type type) @@ -311,7 +311,7 @@ cbdataInternalAlloc(cbdata_type type) c->locks = 0; c->cookie = (long) c ^ cbdata::Cookie; cbdataCount++; -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG c->file = file; c->line = line; @@ -325,7 +325,7 @@ cbdataInternalAlloc(cbdata_type type) } void * -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG cbdataInternalFreeDbg(void *p, const char *file, int line) #else cbdataInternalFree(void *p) @@ -337,7 +337,7 @@ cbdataInternalFree(void *p) #else c = (cbdata *) (((char *) p) - cbdata::Offset); #endif -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG debugs(45, 3, "cbdataFree: " << p << " " << file << ":" << line); #else @@ -348,7 +348,7 @@ cbdataInternalFree(void *p) c->check(__LINE__); assert(c->valid); c->valid = 0; -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG c->addHistory("Free", file, line); #endif @@ -360,7 +360,7 @@ cbdataInternalFree(void *p) cbdataCount--; debugs(45, 9, "cbdataFree: Freeing " << p); -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG dlinkDelete(&c->link, &cbdataEntries); #endif @@ -388,7 +388,7 @@ cbdataInternalFree(void *p) } void -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG cbdataInternalLockDbg(const void *p, const char *file, int line) #else cbdataInternalLock(const void *p) @@ -405,7 +405,7 @@ cbdataInternalLock(const void *p) c = (cbdata *) (((char *) p) - cbdata::Offset); #endif -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG debugs(45, 3, "cbdataLock: " << p << "=" << (c ? c->locks + 1 : -1) << " " << file << ":" << line); @@ -425,7 +425,7 @@ cbdataInternalLock(const void *p) } void -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG cbdataInternalUnlockDbg(const void *p, const char *file, int line) #else cbdataInternalUnlock(const void *p) @@ -442,7 +442,7 @@ cbdataInternalUnlock(const void *p) c = (cbdata *) (((char *) p) - cbdata::Offset); #endif -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG debugs(45, 3, "cbdataUnlock: " << p << "=" << (c ? c->locks - 1 : -1) << " " << file << ":" << line); @@ -469,7 +469,7 @@ cbdataInternalUnlock(const void *p) debugs(45, 9, "cbdataUnlock: Freeing " << p); -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG dlinkDelete(&c->link, &cbdataEntries); @@ -520,7 +520,7 @@ cbdataReferenceValid(const void *p) } int -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG cbdataInternalReferenceDoneValidDbg(void **pp, void **tp, const char *file, int line) #else cbdataInternalReferenceDoneValid(void **pp, void **tp) @@ -529,7 +529,7 @@ cbdataInternalReferenceDoneValid(void **pp, void **tp) void *p = (void *) *pp; int valid = cbdataReferenceValid(p); *pp = NULL; -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG cbdataInternalUnlockDbg(p, file, line); #else @@ -546,7 +546,7 @@ cbdataInternalReferenceDoneValid(void **pp, void **tp) } } -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG void cbdata::dump(StoreEntry *sentry) const { @@ -575,7 +575,7 @@ static void cbdataDump(StoreEntry * sentry) { storeAppendPrintf(sentry, "%d cbdata entries\n", cbdataCount); -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG storeAppendPrintf(sentry, "Pointer\tType\tLocks\tAllocated by\n"); CBDataDumper dumper(sentry); @@ -597,7 +597,7 @@ cbdataDump(StoreEntry * sentry) } #else - storeAppendPrintf(sentry, "detailed allocation information only available when compiled with CBDATA_DEBUG\n"); + storeAppendPrintf(sentry, "detailed allocation information only available when compiled with --enable-debug-cbdata\n"); #endif @@ -606,7 +606,7 @@ cbdataDump(StoreEntry * sentry) CBDATA_CLASS_INIT(generic_cbdata); -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG struct CBDataCallDumper : public unary_function { CBDataCallDumper (StoreEntry *anEntry):where(anEntry) {} diff --git a/src/cbdata.h b/src/cbdata.h index 05b920d7de..f42ba42f8f 100644 --- a/src/cbdata.h +++ b/src/cbdata.h @@ -238,7 +238,7 @@ typedef enum { /// \ingroup CBDATAAPI extern void cbdataRegisterWithCacheManager(void); -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG extern void *cbdataInternalAllocDbg(cbdata_type type, const char *, int); extern void *cbdataInternalFreeDbg(void *p, const char *, int); extern void cbdataInternalLockDbg(const void *p, const char *, int); @@ -278,7 +278,7 @@ extern cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, in /* cbdata macros */ -#if CBDATA_DEBUG +#if USE_CBDATA_DEBUG #define cbdataAlloc(type) ((type *)cbdataInternalAllocDbg(CBDATA_##type,__FILE__,__LINE__)) #define cbdataFree(var) do {if (var) {cbdataInternalFreeDbg(var,__FILE__,__LINE__); var = NULL;}} while(0) #define cbdataInternalLock(a) cbdataInternalLockDbg(a,__FILE__,__LINE__) @@ -297,7 +297,7 @@ extern cbdata_type cbdataInternalAddType(cbdata_type type, const char *label, in if (address) cbdataInternalFreeDbg(address,__FILE__,__LINE__); \ } \ void *toCbdata() { return this; } -#else /* CBDATA_DEBUG */ +#else /* USE_CBDATA_DEBUG */ /** \ingroup CBDATAAPI diff --git a/src/cf.data.pre b/src/cf.data.pre index 5ed6f4110e..01b357d6b4 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -948,7 +948,7 @@ DOC_END NAME: delay_pool_uses_indirect_client COMMENT: on|off TYPE: onoff -IFDEF: FOLLOW_X_FORWARDED_FOR&&DELAY_POOLS +IFDEF: FOLLOW_X_FORWARDED_FOR&&USE_DELAY_POOLS DEFAULT: on LOC: Config.onoff.delay_pool_uses_indirect_client DOC_START @@ -4758,7 +4758,7 @@ COMMENT_END NAME: delay_pools TYPE: delay_pool_count DEFAULT: 0 -IFDEF: DELAY_POOLS +IFDEF: USE_DELAY_POOLS LOC: Config.Delay DOC_START This represents the number of delay pools to be used. For example, @@ -4769,7 +4769,7 @@ DOC_END NAME: delay_class TYPE: delay_pool_class DEFAULT: none -IFDEF: DELAY_POOLS +IFDEF: USE_DELAY_POOLS LOC: Config.Delay DOC_START This defines the class of each delay pool. There must be exactly one @@ -4820,7 +4820,7 @@ DOC_END NAME: delay_access TYPE: delay_pool_access DEFAULT: none -IFDEF: DELAY_POOLS +IFDEF: USE_DELAY_POOLS LOC: Config.Delay DOC_START This is used to determine which delay pool a request falls into. @@ -4844,7 +4844,7 @@ DOC_END NAME: delay_parameters TYPE: delay_pool_rates DEFAULT: none -IFDEF: DELAY_POOLS +IFDEF: USE_DELAY_POOLS LOC: Config.Delay DOC_START This defines the parameters for a delay pool. Each delay pool has @@ -4925,7 +4925,7 @@ NAME: delay_initial_bucket_level COMMENT: (percent, 0-100) TYPE: ushort DEFAULT: 50 -IFDEF: DELAY_POOLS +IFDEF: USE_DELAY_POOLS LOC: Config.Delay.initial DOC_START The initial bucket percentage is used to determine how much is put @@ -4943,7 +4943,7 @@ COMMENT_END NAME: client_delay_pools TYPE: client_delay_pool_count DEFAULT: 0 -IFDEF: DELAY_POOLS +IFDEF: USE_DELAY_POOLS LOC: Config.ClientDelay DOC_START This option specifies the number of client delay pools used. It must @@ -4957,7 +4957,7 @@ NAME: client_delay_initial_bucket_level COMMENT: (percent, 0-no_limit) TYPE: ushort DEFAULT: 50 -IFDEF: DELAY_POOLS +IFDEF: USE_DELAY_POOLS LOC: Config.ClientDelay.initial DOC_START This option determines the initial bucket size as a percentage of @@ -4976,7 +4976,7 @@ DOC_END NAME: client_delay_parameters TYPE: client_delay_pool_rates DEFAULT: none -IFDEF: DELAY_POOLS +IFDEF: USE_DELAY_POOLS LOC: Config.ClientDelay DOC_START @@ -5003,7 +5003,7 @@ DOC_END NAME: client_delay_access TYPE: client_delay_pool_access DEFAULT: none -IFDEF: DELAY_POOLS +IFDEF: USE_DELAY_POOLS LOC: Config.ClientDelay DOC_START diff --git a/src/cf_gen_defines b/src/cf_gen_defines index 37615ed510..a26081be0d 100644 --- a/src/cf_gen_defines +++ b/src/cf_gen_defines @@ -5,9 +5,9 @@ BEGIN { print "*/" print "#include \"config.h\"" print "static struct { const char *name; const char *enable; int defined;} defines[] = {" - define["DELAY_POOLS"]="--enable-delay-pools" + define["USE_DELAY_POOLS"]="--enable-delay-pools" define["FOLLOW_X_FORWARDED_FOR"]="--enable-follow-x-forwarded-for" - define["FOLLOW_X_FORWARDED_FOR&&DELAY_POOLS"]="--enable-follow-x-forwarded-for and --enable-delay-pools" + define["FOLLOW_X_FORWARDED_FOR&&USE_DELAY_POOLS"]="--enable-follow-x-forwarded-for and --enable-delay-pools" define["FOLLOW_X_FORWARDED_FOR&&ICAP_CLIENT"]="--enable-follow-x-forwarded-for and --enable-icap-client" define["FOLLOW_X_FORWARDED_FOR&&LINUX_NETFILTER"]="--enable-follow-x-forwarded-for and --enable-linux-netfilter" define["USE_HTTP_VIOLATIONS"]="--enable-http-violations" diff --git a/src/client_db.cc b/src/client_db.cc index 500049a008..d476980693 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -49,7 +49,7 @@ static FREE clientdbFreeItem; static void clientdbStartGC(void); static void clientdbScheduledGC(void *); -#if DELAY_POOLS +#if USE_DELAY_POOLS static int max_clients = 32768; #else static int max_clients = 32; @@ -59,7 +59,7 @@ static int cleanup_running = 0; static int cleanup_scheduled = 0; static int cleanup_removed; -#if DELAY_POOLS +#if USE_DELAY_POOLS #define CLIENT_DB_HASH_SIZE 65357 #else #define CLIENT_DB_HASH_SIZE 467 @@ -74,7 +74,7 @@ clientdbAdd(const Ip::Address &addr) c = (ClientInfo *)memAllocate(MEM_CLIENT_INFO); c->hash.key = addr.NtoA(buf,MAX_IPSTRLEN); c->addr = addr; -#if DELAY_POOLS +#if USE_DELAY_POOLS /* setup default values for client write limiter */ c->writeLimitingActive=false; c->writeSpeedLimit=0; @@ -118,7 +118,7 @@ clientdbInit(void) client_table = hash_create((HASHCMP *) strcmp, CLIENT_DB_HASH_SIZE, hash_string); } -#if DELAY_POOLS +#if USE_DELAY_POOLS /* returns ClientInfo for given IP addr Returns NULL if no such client (or clientdb turned off) (it is assumed that clientdbEstablished will be called before and create client record if needed) @@ -346,7 +346,7 @@ clientdbFreeItem(void *data) ClientInfo *c = (ClientInfo *)data; safe_free(c->hash.key); -#if DELAY_POOLS +#if USE_DELAY_POOLS if (CommQuotaQueue *q = c->quotaQueue) { q->clientInfo = NULL; delete q; // invalidates cbdata, cancelling any pending kicks diff --git a/src/client_side.cc b/src/client_side.cc index 6abeb3e5fc..58eb9e7bdd 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -112,7 +112,7 @@ #include "SquidTime.h" #include "Store.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "ClientInfo.h" #endif @@ -3165,7 +3165,7 @@ httpAccept(int sock, int newfd, ConnectionDetail *details, clientdbEstablished(details->peer, 1); -#if DELAY_POOLS +#if USE_DELAY_POOLS fd_table[newfd].clientInfo = NULL; if (Config.onoff.client_db) { diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 793d5b828c..afcaafaa4f 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -44,7 +44,7 @@ #include "client_side.h" #include "client_side_reply.h" #include "clientStream.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPools.h" #endif #include "errorpage.h" @@ -251,7 +251,7 @@ clientReplyContext::processExpired() http->log_uri, http->request->flags, http->request->method); /* NOTE, don't call StoreEntry->lock(), storeCreateEntry() does it */ sc = storeClientListAdd(entry, this); -#if DELAY_POOLS +#if USE_DELAY_POOLS /* delay_id is already set on original store client */ sc->setDelayId(DelayId::DelayClient(http)); #endif @@ -564,7 +564,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result) * plain ol' cache hit */ -#if DELAY_POOLS +#if USE_DELAY_POOLS if (e->store_status != STORE_OK) http->logType = LOG_TCP_MISS; else @@ -1728,8 +1728,7 @@ clientReplyContext::doGetMoreData() } sc = storeClientListAdd(http->storeEntry(), this); -#if DELAY_POOLS - +#if USE_DELAY_POOLS sc->setDelayId(DelayId::DelayClient(http)); #endif @@ -2124,10 +2123,8 @@ clientReplyContext::createStoreEntry(const HttpRequestMethod& m, request_flags r sc = storeClientListAdd(e, this); -#if DELAY_POOLS - +#if USE_DELAY_POOLS sc->setDelayId(DelayId::DelayClient(http)); - #endif reqofs = 0; diff --git a/src/comm.cc b/src/comm.cc index fc7e131f3f..7cc28e5b7a 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -74,7 +74,7 @@ static IOCB commHalfClosedReader; static void comm_init_opened(int new_socket, Ip::Address &addr, tos_t tos, nfmark_t nfmark, const char *note, struct addrinfo *AI); static int comm_apply_flags(int new_socket, Ip::Address &addr, int flags, struct addrinfo *AI); -#if DELAY_POOLS +#if USE_DELAY_POOLS CBDATA_CLASS_INIT(CommQuotaQueue); static void commHandleWriteHelper(void * data); @@ -1473,7 +1473,7 @@ _comm_close(int fd, char const *file, int line) COMMIO_FD_READCB(fd)->finish(COMM_ERR_CLOSING, errno); } -#if DELAY_POOLS +#if USE_DELAY_POOLS if (ClientInfo *clientInfo = F->clientInfo) { if (clientInfo->selectWaiting) { clientInfo->selectWaiting = false; @@ -1823,7 +1823,7 @@ comm_exit(void) Comm::CallbackTableDestruct(); } -#if DELAY_POOLS +#if USE_DELAY_POOLS // called when the queue is done waiting for the client bucket to fill void commHandleWriteHelper(void * data) diff --git a/src/comm/IoCallback.cc b/src/comm/IoCallback.cc index b7b0d751f5..4e5b2bdf56 100644 --- a/src/comm/IoCallback.cc +++ b/src/comm/IoCallback.cc @@ -54,7 +54,7 @@ Comm::IoCallback::setCallback(Comm::iocb_type t, AsyncCall::Pointer &cb, char *b void Comm::IoCallback::selectOrQueueWrite() { -#if DELAY_POOLS +#if USE_DELAY_POOLS // stand in line if there is one if (ClientInfo *clientInfo = fd_table[fd].clientInfo) { if (clientInfo->writeLimitingActive) { @@ -89,7 +89,7 @@ Comm::IoCallback::reset() } xerrno = 0; -#if DELAY_POOLS +#if USE_DELAY_POOLS quotaQueueReserv = 0; #endif } diff --git a/src/comm/IoCallback.h b/src/comm/IoCallback.h index fc404460ef..0c390567ba 100644 --- a/src/comm/IoCallback.h +++ b/src/comm/IoCallback.h @@ -26,7 +26,7 @@ public: int offset; comm_err_t errcode; int xerrno; -#if DELAY_POOLS +#if USE_DELAY_POOLS unsigned int quotaQueueReserv; ///< reservation ID from CommQuotaQueue #endif diff --git a/src/comm/Write.cc b/src/comm/Write.cc index a348863de4..e906d99111 100644 --- a/src/comm/Write.cc +++ b/src/comm/Write.cc @@ -1,5 +1,5 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "ClientInfo.h" #endif #include "comm/IoCallback.h" @@ -51,7 +51,7 @@ Comm::HandleWrite(int fd, void *data) nleft = state->size - state->offset; -#if DELAY_POOLS +#if USE_DELAY_POOLS ClientInfo * clientInfo=fd_table[fd].clientInfo; if (clientInfo && !clientInfo->writeLimitingActive) @@ -83,13 +83,13 @@ Comm::HandleWrite(int fd, void *data) } } -#endif +#endif /* USE_DELAY_POOLS */ /* actually WRITE data */ len = FD_WRITE_METHOD(fd, state->buf + state->offset, nleft); debugs(5, 5, HERE << "write() returns " << len); -#if DELAY_POOLS +#if USE_DELAY_POOLS if (clientInfo) { if (len > 0) { /* we wrote data - drain them from bucket */ @@ -103,7 +103,7 @@ Comm::HandleWrite(int fd, void *data) // even if we wrote nothing, we were served; give others a chance clientInfo->kickQuotaQueue(); } -#endif +#endif /* USE_DELAY_POOLS */ fd_bytes(fd, len, FD_WRITE); statCounter.syscalls.sock.writes++; diff --git a/src/delay_pools.cc b/src/delay_pools.cc index 82fda98d0e..566291e816 100644 --- a/src/delay_pools.cc +++ b/src/delay_pools.cc @@ -41,7 +41,7 @@ #include "config.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "squid.h" #include "mgr/Registration.h" #include "DelaySpec.h" @@ -1034,5 +1034,4 @@ ClassCHostPool::Id::bytesIn(int qty) theClassCHost->buckets.values[theNet].individuals.values[theHost].bytesIn (qty); } -#endif - +#endif /* USE_DELAY_POOLS */ diff --git a/src/fde.h b/src/fde.h index 05e2c899a0..8cdfdd1a2b 100644 --- a/src/fde.h +++ b/src/fde.h @@ -33,7 +33,7 @@ #include "comm.h" #include "ip/Address.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS class ClientInfo; #endif class PconnPool; @@ -92,7 +92,7 @@ public: PconnPool *pool; } pconn; -#if DELAY_POOLS +#if USE_DELAY_POOLS ClientInfo * clientInfo;/* pointer to client info used in client write limiter or NULL if not present */ #endif unsigned epoll_state; @@ -147,7 +147,7 @@ private: bytes_written = 0; pconn.uses = 0; pconn.pool = NULL; -#if DELAY_POOLS +#if USE_DELAY_POOLS clientInfo = NULL; #endif epoll_state = 0; diff --git a/src/ftp.cc b/src/ftp.cc index 1598a9861e..ed3f22dceb 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -57,7 +57,7 @@ #include "URLScheme.h" #include "wordlist.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPools.h" #include "MemObject.h" #endif @@ -1199,7 +1199,7 @@ FtpStateData::dataRead(const CommIoCbParams &io) if (io.flag == COMM_OK && io.size > 0) { debugs(9,5,HERE << "appended " << io.size << " bytes to readBuf"); data.readBuf->appended(io.size); -#if DELAY_POOLS +#if USE_DELAY_POOLS DelayId delayId = entry->mem_obj->mostBytesAllowed(); delayId.bytesIn(io.size); #endif diff --git a/src/gopher.cc b/src/gopher.cc index 5023d83e9e..5b31f3a395 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -41,7 +41,7 @@ #include "HttpRequest.h" #include "HttpReply.h" #include "comm.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPools.h" #include "MemObject.h" #endif @@ -777,8 +777,7 @@ gopherReadReply(int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void int bin; size_t read_sz = BUFSIZ; int do_next_read = 0; -#if DELAY_POOLS - +#if USE_DELAY_POOLS DelayId delayId = entry->mem_obj->mostBytesAllowed(); #endif @@ -796,15 +795,14 @@ gopherReadReply(int fd, char *buf, size_t len, comm_err_t flag, int xerrno, void } errno = 0; -#if DELAY_POOLS - +#if USE_DELAY_POOLS read_sz = delayId.bytesWanted(1, read_sz); #endif /* leave one space for \0 in gopherToHTML */ if (flag == COMM_OK && len > 0) { -#if DELAY_POOLS +#if USE_DELAY_POOLS delayId.bytesIn(len); #endif diff --git a/src/http.cc b/src/http.cc index 2595c85160..c162f2d878 100644 --- a/src/http.cc +++ b/src/http.cc @@ -46,7 +46,7 @@ #include "base/TextException.h" #include "base64.h" #include "comm/Write.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPools.h" #endif #include "errorpage.h" @@ -134,10 +134,8 @@ HttpStateData::HttpStateData(FwdState *theFwdState) : AsyncJob("HttpStateData"), if (_peer->options.proxy_only) entry->releaseRequest(); -#if DELAY_POOLS - +#if USE_DELAY_POOLS entry->setNoDelay(_peer->options.no_delay); - #endif } @@ -1123,8 +1121,7 @@ HttpStateData::readReply(const CommIoCbParams &io) if (len > 0) { readBuf->appended(len); reply_bytes_read += len; -#if DELAY_POOLS - +#if USE_DELAY_POOLS DelayId delayId = entry->mem_obj->mostBytesAllowed(); delayId.bytesIn(len); #endif diff --git a/src/main.cc b/src/main.cc index 7871413714..4ac574d01a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -39,8 +39,14 @@ #endif #include "auth/Gadgets.h" #include "base/TextException.h" +#if USE_DELAY_POOLS +#include "ClientDelayConfig.h" +#endif #include "ConfigParser.h" #include "CpuAffinity.h" +#if USE_DELAY_POOLS +#include "DelayPools.h" +#endif #include "errorpage.h" #include "event.h" #include "EventLoop.h" @@ -80,10 +86,6 @@ #include "icmp/IcmpSquid.h" #include "icmp/net_db.h" -#if DELAY_POOLS -#include "ClientDelayConfig.h" -#endif - #if USE_LOADABLE_MODULES #include "LoadableModules.h" #endif @@ -857,7 +859,7 @@ mainReconfigureFinish(void *) mimeInit(Config.mimeTablePathname); -#if DELAY_POOLS +#if USE_DELAY_POOLS Config.ClientDelay.finalize(); #endif @@ -952,10 +954,6 @@ mainSetCwd(void) } } -#if DELAY_POOLS -#include "DelayPools.h" -#endif - static void mainInitialize(void) { @@ -1086,8 +1084,7 @@ mainInitialize(void) do_mallinfo = 1; mimeInit(Config.mimeTablePathname); refreshInit(); -#if DELAY_POOLS - +#if USE_DELAY_POOLS DelayPools::Init(); #endif @@ -1183,7 +1180,7 @@ mainInitialize(void) Esi::Init(); #endif -#if DELAY_POOLS +#if USE_DELAY_POOLS Config.ClientDelay.finalize(); #endif @@ -1856,8 +1853,7 @@ SquidShutdown() Esi::Clean(); #endif -#if DELAY_POOLS - +#if USE_DELAY_POOLS DelayPools::FreePools(); #endif diff --git a/src/neighbors.cc b/src/neighbors.cc index 76edcc34d7..4402bd1077 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1618,11 +1618,9 @@ dump_peer_options(StoreEntry * sentry, peer * p) if (p->options.no_netdb_exchange) storeAppendPrintf(sentry, " no-netdb-exchange"); -#if DELAY_POOLS - +#if USE_DELAY_POOLS if (p->options.no_delay) storeAppendPrintf(sentry, " no-delay"); - #endif if (p->login) diff --git a/src/protos.h b/src/protos.h index c78891c23f..beb25ecd12 100644 --- a/src/protos.h +++ b/src/protos.h @@ -45,7 +45,7 @@ class HttpRequestMethod; -#if DELAY_POOLS +#if USE_DELAY_POOLS class ClientInfo; #endif @@ -92,7 +92,7 @@ void clientdbDump(StoreEntry *); SQUIDCEXTERN void clientdbFreeMemory(void); SQUIDCEXTERN int clientdbEstablished(const Ip::Address &, int); -#if DELAY_POOLS +#if USE_DELAY_POOLS SQUIDCEXTERN void clientdbSetWriteLimiter(ClientInfo * info, const int writeSpeedLimit,const double initialBurst,const double highWatermark); SQUIDCEXTERN ClientInfo * clientdbGetInfo(const Ip::Address &addr); #endif diff --git a/src/stat.cc b/src/stat.cc index 922ee4a3b6..47143b2882 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -42,7 +42,7 @@ #include "MemObject.h" #include "fde.h" #include "mem_node.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayId.h" #endif #include "client_side_request.h" @@ -2071,10 +2071,8 @@ statClientRequests(StoreEntry * s) storeAppendPrintf(s, "username %s\n", p); -#if DELAY_POOLS - +#if USE_DELAY_POOLS storeAppendPrintf(s, "delay_pool %d\n", DelayId::DelayClient(http).pool()); - #endif storeAppendPrintf(s, "\n"); diff --git a/src/store.cc b/src/store.cc index 0e1fabc63b..af732464eb 100644 --- a/src/store.cc +++ b/src/store.cc @@ -46,7 +46,7 @@ #include "mem_node.h" #include "StoreMeta.h" #include "SwapDir.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPools.h" #endif #include "Stack.h" @@ -237,14 +237,12 @@ StoreEntry::delayAwareRead(int fd, char *buf, int len, AsyncCall::Pointer callba assert (mem_obj); /* read ahead limit */ /* Perhaps these two calls should both live in MemObject */ -#if DELAY_POOLS - +#if USE_DELAY_POOLS if (!mem_obj->readAheadPolicyCanRead()) { #endif mem_obj->delayRead(DeferredRead(DeferReader, this, CommRead(fd, buf, len, callback))); return; -#if DELAY_POOLS - +#if USE_DELAY_POOLS } /* delay id limit */ diff --git a/src/store_client.cc b/src/store_client.cc index 20d4ddb88f..50ac793d0b 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -42,7 +42,7 @@ #include "MemObject.h" #include "StoreMeta.h" #include "StoreMetaUnpacker.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPools.h" #endif #include "HttpRequest.h" @@ -181,7 +181,7 @@ storeClientCopyEvent(void *data) } store_client::store_client(StoreEntry *e) : entry (e) -#if DELAY_POOLS +#if USE_DELAY_POOLS , delayId() #endif , type (e->storeClientType()) @@ -889,11 +889,10 @@ store_client::Callback::pending() const store_client::Callback::Callback(STCB *function, void *data) : callback_handler(function), callback_data (data) {} -#if DELAY_POOLS +#if USE_DELAY_POOLS void store_client::setDelayId(DelayId delay_id) { delayId = delay_id; } - #endif diff --git a/src/structs.h b/src/structs.h index 633e4233c0..86ba396553 100644 --- a/src/structs.h +++ b/src/structs.h @@ -123,7 +123,7 @@ struct relist { relist *next; }; -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayConfig.h" #include "ClientDelayConfig.h" #endif @@ -532,7 +532,7 @@ struct SquidConfig { struct { int64_t limit; } MemPools; -#if DELAY_POOLS +#if USE_DELAY_POOLS DelayConfig Delay; ClientDelayConfig ClientDelay; @@ -885,7 +885,7 @@ struct peer { unsigned int htcp_forward_clr:1; #endif unsigned int no_netdb_exchange:1; -#if DELAY_POOLS +#if USE_DELAY_POOLS unsigned int no_delay:1; #endif unsigned int allow_miss:1; diff --git a/src/tests/stub_DelayId.cc b/src/tests/stub_DelayId.cc index f74922028f..c2d926efb1 100644 --- a/src/tests/stub_DelayId.cc +++ b/src/tests/stub_DelayId.cc @@ -34,9 +34,7 @@ #include "config.h" - -#if DELAY_POOLS - +#if USE_DELAY_POOLS #include "squid.h" #include "DelayId.h" @@ -48,4 +46,4 @@ DelayId::delayRead(DeferredRead const&) DelayId::~DelayId() {} -#endif +#endif /* USE_DELAY_POOLS */ diff --git a/src/tests/stub_MemObject.cc b/src/tests/stub_MemObject.cc index 7189bdb5fe..9863612fc4 100644 --- a/src/tests/stub_MemObject.cc +++ b/src/tests/stub_MemObject.cc @@ -35,7 +35,7 @@ #include "squid.h" #include "MemObject.h" #include "HttpReply.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayPools.h" #endif @@ -112,7 +112,7 @@ MemObject::mostBytesWanted(int max) const return -1; } -#if DELAY_POOLS +#if USE_DELAY_POOLS DelayId MemObject::mostBytesAllowed() const { @@ -120,7 +120,6 @@ MemObject::mostBytesAllowed() const fatal ("Not implemented"); return result; } - #endif void diff --git a/src/tunnel.cc b/src/tunnel.cc index a501859f73..c17d627844 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -41,7 +41,7 @@ #include "comm/Write.h" #include "client_side_request.h" #include "acl/FilledChecklist.h" -#if DELAY_POOLS +#if USE_DELAY_POOLS #include "DelayId.h" #endif #include "client_side.h" @@ -81,7 +81,7 @@ public: void fd(int const newFD); int bytesWanted(int lower=0, int upper = INT_MAX) const; void bytesIn(int const &); -#if DELAY_POOLS +#if USE_DELAY_POOLS void setDelayId(DelayId const &); #endif @@ -96,7 +96,7 @@ public: private: int fd_; -#if DELAY_POOLS +#if USE_DELAY_POOLS DelayId delayId; #endif @@ -189,7 +189,7 @@ TunnelStateData::Connection::~Connection() int TunnelStateData::Connection::bytesWanted(int lowerbound, int upperbound) const { -#if DELAY_POOLS +#if USE_DELAY_POOLS return delayId.bytesWanted(lowerbound, upperbound); #else @@ -200,7 +200,7 @@ TunnelStateData::Connection::bytesWanted(int lowerbound, int upperbound) const void TunnelStateData::Connection::bytesIn(int const &count) { -#if DELAY_POOLS +#if USE_DELAY_POOLS delayId.bytesIn(count); #endif @@ -692,7 +692,7 @@ tunnelStart(ClientHttpRequest * http, int64_t * size_ptr, int *status_ptr) request->hier.peer_local_port = comm_local_port(sock); // for %server.setDelayId(DelayId::DelayClient(http)); #endif @@ -793,7 +793,7 @@ tunnelPeerSelectComplete(FwdServer * fs, void *data) tunnelState->request->flags.proxying = 0; } -#if DELAY_POOLS +#if USE_DELAY_POOLS /* no point using the delayIsNoDelay stuff since tunnel is nice and simple */ if (g && g->options.no_delay) tunnelState->server.setDelayId(DelayId()); @@ -836,7 +836,7 @@ TunnelStateData::noConnections() const return fd_closed(server.fd()) && fd_closed(client.fd()); } -#if DELAY_POOLS +#if USE_DELAY_POOLS void TunnelStateData::Connection::setDelayId(DelayId const &newDelay) {