]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/DelayConfig.cc
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 77 Delay Pools */
15 #include "acl/Gadgets.h"
16 #include "ConfigParser.h"
17 #include "DelayConfig.h"
18 #include "DelayPool.h"
19 #include "DelayPools.h"
23 DelayConfig::parsePoolCount()
25 unsigned short pools_
;
26 ConfigParser::ParseUShort(&pools_
);
27 DelayPools::pools(pools_
);
31 DelayConfig::parsePoolClass()
35 ConfigParser::ParseUShort(&pool
);
37 if (pool
< 1 || pool
> DelayPools::pools()) {
38 debugs(3, DBG_CRITICAL
, "parse_delay_pool_class: Ignoring pool " << pool
<< " not in 1 .. " << DelayPools::pools());
42 unsigned short delay_class_
;
43 ConfigParser::ParseUShort(&delay_class_
);
45 if (delay_class_
< 1 || delay_class_
> 5) {
46 debugs(3, DBG_CRITICAL
, "parse_delay_pool_class: Ignoring pool " << pool
<< " class " << delay_class_
<< " not in 1 .. 5");
52 DelayPools::delay_data
[pool
].createPool(delay_class_
);
56 DelayConfig::parsePoolRates()
59 ConfigParser::ParseUShort(&pool
);
61 if (pool
< 1 || pool
> DelayPools::pools()) {
62 debugs(3, DBG_CRITICAL
, "parse_delay_pool_rates: Ignoring pool " << pool
<< " not in 1 .. " << DelayPools::pools());
68 if (!DelayPools::delay_data
[pool
].theComposite().getRaw()) {
69 debugs(3, DBG_CRITICAL
, "parse_delay_pool_rates: Ignoring pool " << pool
+ 1 << " attempt to set rates with class not set");
73 DelayPools::delay_data
[pool
].parse();
77 DelayConfig::parsePoolAccess(ConfigParser
&parser
)
81 ConfigParser::ParseUShort(&pool
);
83 if (pool
< 1 || pool
> DelayPools::pools()) {
84 debugs(3, DBG_CRITICAL
, "parse_delay_pool_rates: Ignoring pool " << pool
<< " not in 1 .. " << DelayPools::pools());
89 aclParseAccessLine("delay_access", parser
, &DelayPools::delay_data
[pool
].access
);
93 DelayConfig::freePoolCount()
95 DelayPools::FreePools();
100 DelayConfig::dumpPoolCount(StoreEntry
* entry
, const char *name
) const
104 if (!DelayPools::pools()) {
105 storeAppendPrintf(entry
, "%s 0\n", name
);
109 storeAppendPrintf(entry
, "%s %d\n", name
, DelayPools::pools());
111 for (i
= 0; i
< DelayPools::pools(); ++i
)
112 DelayPools::delay_data
[i
].dump (entry
, i
);
115 #endif /* USE_DELAY_POOLS */