* Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
*/
-#include "config.h"
+#include "squid.h"
/* 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 "squid-old.h"
#include "DelayId.h"
#include "client_side_request.h"
-#include "ACLChecklist.h"
+#include "acl/FilledChecklist.h"
#include "DelayPools.h"
#include "DelayPool.h"
#include "HttpRequest.h"
}
for (pool = 0; pool < DelayPools::pools(); pool++) {
- ACLChecklist ch;
+
+ /* pools require explicit 'allow' to assign a client into them */
+ if (!DelayPools::delay_data[pool].access) {
+ debugs(77, DBG_IMPORTANT, "delay_pool " << pool <<
+ " has no delay_access configured. This means that no clients will ever use it.");
+ continue;
+ }
+
+ ACLFilledChecklist ch(DelayPools::delay_data[pool].access, r, NULL);
#if FOLLOW_X_FORWARDED_FOR
if (Config.onoff.delay_pool_uses_indirect_client)
ch.src_addr = r->indirect_client_addr;
if (http->getConn() != NULL)
ch.conn(http->getConn());
- ch.request = HTTPMSGLOCK(r);
-
- ch.accessList = cbdataReference(DelayPools::delay_data[pool].access);
-
- /* cbdataReferenceDone() happens in either fastCheck() or ~ACLCheckList */
+ if (DelayPools::delay_data[pool].theComposite().getRaw() && ch.fastCheck() == ACCESS_ALLOWED) {
- if (DelayPools::delay_data[pool].theComposite().getRaw() &&
- ch.fastCheck()) {
DelayId result (pool + 1);
CompositePoolNode::CompositeSelectionDetails details;
details.src_addr = ch.src_addr;
+#if USE_AUTH
details.user = r->auth_user_request;
+#endif
details.tag = r->tag;
result.compositePosition(DelayPools::delay_data[pool].theComposite()->id(details));
return result;
}
-#endif /* DELAY_POOLS */
+#endif /* USE_DELAY_POOLS */