]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Policy: use USE_* from code wrappers and ENABLE_* for conditionals.
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 27 Nov 2010 06:44:33 +0000 (23:44 -0700)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 27 Nov 2010 06:44:33 +0000 (23:44 -0700)
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.

52 files changed:
configure.in
squid3.dox
src/ClientInfo.h
src/CommonPool.h
src/CompositePoolNode.h
src/DelayBucket.cc
src/DelayConfig.cc
src/DelayId.cc
src/DelayId.h
src/DelayIdComposite.h
src/DelayPool.cc
src/DelayPool.h
src/DelaySpec.cc
src/DelayTagged.cc
src/DelayTagged.h
src/DelayUser.cc
src/DelayUser.h
src/DelayVector.cc
src/DelayVector.h
src/Makefile.am
src/MemObject.cc
src/MemObject.h
src/NullDelayId.cc
src/NullDelayId.h
src/StoreClient.h
src/cache_cf.cc
src/cbdata.cc
src/cbdata.h
src/cf.data.pre
src/cf_gen_defines
src/client_db.cc
src/client_side.cc
src/client_side_reply.cc
src/comm.cc
src/comm/IoCallback.cc
src/comm/IoCallback.h
src/comm/Write.cc
src/delay_pools.cc
src/fde.h
src/ftp.cc
src/gopher.cc
src/http.cc
src/main.cc
src/neighbors.cc
src/protos.h
src/stat.cc
src/store.cc
src/store_client.cc
src/structs.h
src/tests/stub_DelayId.cc
src/tests/stub_MemObject.cc
src/tunnel.cc

index 2229784b52de0e23c64f76f830412976bc45b8bd..d557f397b0ab15d6a9a1bf6edddef4a3cec30015 100644 (file)
@@ -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
 ])
 
index 0644a65ff6d5f30979f5a4fc68a04efdec3baf29..91b0b26c21dc09bdee42405118a2398caf16bd27 100644 (file)
@@ -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 \
index f95fa55e7b86011641f447b31adb95737546580c..7201bf8347f660668bd73aa72adb7baeda943f09 100644 (file)
@@ -8,7 +8,7 @@
 #include "cbdata.h"
 #include <deque>
 
-#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
index 8154578587d3d2e87f770b7d40ee37da7364933e..c18c85beb6b8b4db793acb8e2d09bcd3a9bc189f 100644 (file)
@@ -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 */
 
index 89ad43b1891f4814030b3122c254334af9ef8654..70c46dc59bf4a9425d3b33426340f044ceacc6cf 100644 (file)
@@ -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 */
index 1651ff02307cfa17e366137dc327af74437f9ed8..c7722c86da12050f6e516558e6b0470100844125 100644 (file)
 
 #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 */
index fe2aefca56beb7d1f1f5438e9bf1e8f9220bbfa9..3ad5a118ea42f91a4e1ea2fc3c7ee1289af8bd21 100644 (file)
@@ -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 */
index 8337f37a5941ba6b40ce375c1241145a436f1c08..dcfad8930bb81aff024ef0537adfaa2fde5ed9c4 100644 (file)
@@ -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 */
index 1afca60fc34bb762ba561f0f673afad87184435d..975fb66d609f462dacfcd9d2aaaf9bc6c2ef024b 100644 (file)
@@ -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 */
index 9f87e575cdce39400936986258b2c4ede46bbef2..34138ccbe6a74ee2f7079a5ca104be70533a8a91 100644 (file)
@@ -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 */
index d6666c92ff75354a981a1d34be8c98956a80321e..b4871ecc098173dd021f615e98d17b99beedf6c2 100644 (file)
@@ -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 */
index 815ef32dca26a9b24b8049a1bd09681c4d75876c..22d2d73dbfa8227231d3822619cf04eb6c023af5 100644 (file)
@@ -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 */
index 2718eb23ab44f562509f30c286ef48afe2ce3c3f..485cdc34e5474103982176d7052d706b9e6e2f5a 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "config.h"
 
-#if DELAY_POOLS
+#if USE_DELAY_POOLS
 #include "squid.h"
 #include "DelaySpec.h"
 #include "Store.h"
index 1f0d3151b7cfe15525ad8eeb2bc82beec509cff2..a29b749364320ac9438fcf0333ce47d4aecab7d7 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "config.h"
 
-#if DELAY_POOLS
+#if USE_DELAY_POOLS
 #include "squid.h"
 #include "DelayTagged.h"
 #include "NullDelayId.h"
index ad2ed7aa7cae447653661f4783d7fe6677b96559..6bc7ec6439afc0301b3816653b768d7a12fa6221 100644 (file)
@@ -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<DelayTaggedBucket::Pointer> buckets;
 };
 
-#endif /* DELAY_POOLS */
+#endif /* USE_DELAY_POOLS */
 #endif /* DELAYTAGGED_H */
index 7e6e42cc62b824f8af8a6e637f7c235e4191b670..24c20dc2d4f6f4dc22b52214fc978d12187866cd 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "config.h"
 
-#if DELAY_POOLS
+#if USE_DELAY_POOLS
 #include "squid.h"
 #include "DelayUser.h"
 #include "auth/UserRequest.h"
index 6f37fa26188bbf638d5347b964b960ffdccb51dd..9fb36f34ea0b746dff578ef1c972823958e7b619 100644 (file)
@@ -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<DelayUserBucket::Pointer> buckets;
 };
 
-#endif /* DELAY_POOLS */
+#endif /* USE_DELAY_POOLS */
 #endif /* DELAYUSER_H */
index 367cb75d51e1b5a4a6d854d6d99e9f8e0513fde7..eef4ee630380f2dc4963d6c5aa6c4d476cccefe9 100644 (file)
@@ -39,7 +39,7 @@
 
 #include "config.h"
 
-#if DELAY_POOLS
+#if USE_DELAY_POOLS
 #include "squid.h"
 #include "DelayVector.h"
 #include "CommRead.h"
index 7f1002dbe07b767a4ab215035bdcaca2ad5d65fc..a693754cfcb82be9b339ce69b165bb273deaee13 100644 (file)
@@ -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<CompositePoolNode::Pointer>::const_iterator const_iterator;
 };
 
-#endif /* DELAY_POOLS */
+#endif /* USE_DELAY_POOLS */
 #endif /* SQUID_DELAYVECTOR_H */
index 00d06638ee63687e6c6537abfb4b86bdd42baf89..1402f4f106ce5613cbee8f46398e836273770a4d 100644 (file)
@@ -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 = 
index 815bf9bbee4d04c94180f44b33b9e3c9bfd0452a..1f93fe93cbaa8460c004357557519eb4667c0525 100644 (file)
@@ -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
 {
index 3631db6d56f6d1f16e6a05d48c43692f8b27ec45..74cd99442a78b69e5b539bfcac80de869c9b8b58 100644 (file)
@@ -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
 
index 8df67481f1a3b07ca57e61a6bdb020dfafdb3757..87c22e688eee11383b37093fd5d65cb22301b113 100644 (file)
@@ -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 */
index f52c7ec165462f4a6461e153c5038c16c2d4f9f2..6efc3fae62dbf14767f0f2a36bc9f961e0fd4bc0 100644 (file)
@@ -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"
index 4d6429dfbb103e2f979c0df9e9f1910bb49d2962..db1aee6110318cffe726dcb3fdd4fe9f5b5dd010 100644 (file)
@@ -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
index 4f51f752dc8db04a43054fe2ec7a790c06ef6ce7..77c27712627d265f045b4a64a50003cc127da943 100644 (file)
@@ -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);
index c6cc67f5c29cdda88b807e72d187c738699e71b9..72c0617b98798136e4dda56458a073710195dd28 100644 (file)
@@ -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"
 #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<CBDataCall, void> {
     CBDataCallDumper (StoreEntry *anEntry):where(anEntry) {}
index 05b920d7de08f273aaf9708c0a32b1a5be5d0c26..f42ba42f8f9f9cba01facfd95127bf10d3087a7a 100644 (file)
@@ -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
index 5ed6f4110eff6fd84eb46caecd976ea2c4964116..01b357d6b41a5a059752fc6a1c3179c26b92c3ac 100644 (file)
@@ -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
 
index 37615ed510ac8919264c41ce1f9f20cd83dc2cc4..a26081be0d3c131ce1315c33b6d2113e9d268c66 100644 (file)
@@ -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"
index 500049a00812593962d27e5911505953151593fa..d476980693475bbfd3af5bd7522d9a24133a664d 100644 (file)
@@ -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
index 6abeb3e5fc142e0b161bde1a55146eeaab59ade0..58eb9e7bdde5845c2d5c00d3063cf06e0d9b1df5 100644 (file)
 #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) {
index 793d5b828c22d2c63aef63893cf3e6ed53791264..afcaafaa4fa86aec6d57e0ab4064bbfc948ddc62 100644 (file)
@@ -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;
index fc7e131f3fb7f761adacb83c08e9c736696b88ec..7cc28e5b7a6ec31f598187e6c5f0770ddb35dd99 100644 (file)
@@ -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)
index b7b0d751f54040f64b575f32b8c0d09117aa4dd0..4e5b2bdf560b7f3a90d2cd84366f004dc8c394aa 100644 (file)
@@ -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
 }
index fc404460eff8c40e2a63044b7de0a08e7542ab4a..0c390567ba851023fe175b9ca8cad11d866e2fc0 100644 (file)
@@ -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
 
index a348863de4809dbb6b0fa03be41845b02cc71fa1..e906d99111692702de7476a5cac1f700a4c70206 100644 (file)
@@ -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++;
index 82fda98d0e23c9eefb0712c1ac321e696f5f7bad..566291e8168b2c4ec5e7203544bccc2eeae54965 100644 (file)
@@ -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 */
index 05e2c899a0a84e6e7c6bd0b98d35a663f750b1fc..8cdfdd1a2b84ed60f91ce5d17e00ffaf64748122 100644 (file)
--- 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;
index 1598a9861ea86dbf41f4bfd4fd015ff5e28d1851..ed3f22dcebbba00e9ed4100745c1b37085eff9b3 100644 (file)
@@ -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
index 5023d83e9e8f5813e6d01ba7ee71990513688d34..5b31f3a3956da0b9d8aaf6b627cfff4cad689f01 100644 (file)
@@ -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
 
index 2595c8516074315298917b61d43d58298b58f903..c162f2d878ae7d2bf1dbfa1387e2033d623f8fbc 100644 (file)
@@ -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
index 78714137144b82c09623fe43382407a5ba798ce1..4ac574d01ad928ad87d16e323a24db33904b54fa 100644 (file)
 #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"
 #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
 
index 76edcc34d79f82f90232cae9a231a20922311f0f..4402bd107792dc08db4f993d6d46b07023355257 100644 (file)
@@ -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)
index c78891c23ffeea7e89d5963e1244483ce7a1f2cf..beb25ecd120eff185bec377bf2ac972e830e68cb 100644 (file)
@@ -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
index 922ee4a3b62a2ce35f0eeb5cb15086437322f82d..47143b288243ab7e34a9ac0da8304b5f8a53d456 100644 (file)
@@ -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");
index 0e1fabc63b5c4be92168922b719c9d74e3181883..af732464eb7c999ebc8fcdfeefb2ca0130f5cba7 100644 (file)
@@ -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 */
index 20d4ddb88ff8efaf7acd8ab1ea655770b27a72e6..50ac793d0bdbc463c363fa1440edb736fa852a75 100644 (file)
@@ -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
index 633e4233c0530632009c1aadbe1ef78e5ca71fa5..86ba3965538471bc39bbbc141691dded3b03a8b7 100644 (file)
@@ -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;
index f74922028f59b36e6160d26de703868bac67c88e..c2d926efb1f891792ea9266b08570abb63a5af19 100644 (file)
@@ -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 */
index 7189bdb5fe20d114daf2f176129162b05b682598..9863612fc4112693c3cd284e8f3ed62c72b37610 100644 (file)
@@ -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
index a501859f73c8a7e52a2ad6c4cdcd11724d6a893e..c17d627844dd93b0d6e67160f0a9a093bdf8c8d8 100644 (file)
@@ -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 %<lp logging
 
     tunnelState = new TunnelStateData;
-#if DELAY_POOLS
+#if USE_DELAY_POOLS
 
     tunnelState->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)
 {