Adaptation::AccessCheck::AccessCheck(const ServiceFilter &aFilter,
Adaptation::Initiator *initiator):
AsyncJob("AccessCheck"), filter(aFilter),
- theInitiator(initiator),
- acl_checklist(nullptr)
+ theInitiator(initiator)
{
#if ICAP_CLIENT
Adaptation::Icap::History::Pointer h = filter.request->icapHistory();
while (!candidates.empty()) {
if (AccessRule *r = FindRule(topCandidate())) {
/* BUG 2526: what to do when r->acl is empty?? */
- acl_checklist = new ACLFilledChecklist(r->acl, filter.request);
+ const auto acl_checklist = new ACLFilledChecklist(r->acl, filter.request);
acl_checklist->updateAle(filter.al);
acl_checklist->updateReply(filter.reply);
acl_checklist->syncAle(filter.request, nullptr);
if ((addr = asciiaddr)) {
request->indirect_client_addr = addr;
request->x_forwarded_for_iterator.cut(l);
- calloutContext->acl_checklist = clientAclChecklistCreate(Config.accessList.followXFF, http);
+ const auto ch = clientAclChecklistCreate(Config.accessList.followXFF, http);
if (!Config.onoff.acl_uses_indirect_client) {
/* override the default src_addr tested if we have to go deeper than one level into XFF */
- Filled(calloutContext->acl_checklist)->src_addr = request->indirect_client_addr;
+ ch->src_addr = request->indirect_client_addr;
}
if (++calloutContext->currentXffHopNumber < SQUID_X_FORWARDED_FOR_HOP_MAX) {
- calloutContext->acl_checklist->nonBlockingCheck(clientFollowXForwardedForCheck, data);
+ ch->nonBlockingCheck(clientFollowXForwardedForCheck, data);
return;
}
const auto headerName = Http::HeaderLookupTable.lookup(Http::HdrType::X_FORWARDED_FOR).name;
http->request->x_forwarded_for_iterator = http->request->header.getList(Http::HdrType::X_FORWARDED_FOR);
/* begin by checking to see if we trust direct client enough to walk XFF */
- acl_checklist = clientAclChecklistCreate(Config.accessList.followXFF, http);
+ const auto acl_checklist = clientAclChecklistCreate(Config.accessList.followXFF, http);
acl_checklist->nonBlockingCheck(clientFollowXForwardedForCheck, this);
return;
}
#endif
if (Config.accessList.http) {
- acl_checklist = clientAclChecklistCreate(Config.accessList.http, http);
+ const auto acl_checklist = clientAclChecklistCreate(Config.accessList.http, http);
acl_checklist->nonBlockingCheck(clientAccessCheckDoneWrapper, this);
} else {
debugs(0, DBG_CRITICAL, "No http_access configuration found. This will block ALL traffic");
ClientRequestContext::clientAccessCheck2()
{
if (Config.accessList.adapted_http) {
- acl_checklist = clientAclChecklistCreate(Config.accessList.adapted_http, http);
+ const auto acl_checklist = clientAclChecklistCreate(Config.accessList.adapted_http, http);
acl_checklist->nonBlockingCheck(clientAccessCheckDoneWrapper, this);
} else {
debugs(85, 2, "No adapted_http_access configuration. default: ALLOW");
void
ClientRequestContext::clientAccessCheckDone(const Acl::Answer &answer)
{
- acl_checklist = nullptr;
Http::StatusCode status;
debugs(85, 2, "The request " << http->request->method << ' ' <<
http->uri << " is " << answer <<
{
ClientRequestContext *context = (ClientRequestContext *)data;
ClientHttpRequest *http = context->http;
- context->acl_checklist = nullptr;
if (answer.allowed())
redirectStart(http, clientRedirectDoneWrapper, context);
debugs(33, 5, "'" << http->uri << "'");
http->al->syncNotes(http->request);
if (Config.accessList.redirector) {
- acl_checklist = clientAclChecklistCreate(Config.accessList.redirector, http);
+ const auto acl_checklist = clientAclChecklistCreate(Config.accessList.redirector, http);
acl_checklist->nonBlockingCheck(clientRedirectAccessCheckDone, this);
} else
redirectStart(http, clientRedirectDoneWrapper, this);
{
ClientRequestContext *context = static_cast<ClientRequestContext *>(data);
ClientHttpRequest *http = context->http;
- context->acl_checklist = nullptr;
if (answer.allowed())
storeIdStart(http, clientStoreIdDoneWrapper, context);
debugs(33, 5,"'" << http->uri << "'");
if (Config.accessList.store_id) {
- acl_checklist = clientAclChecklistCreate(Config.accessList.store_id, http);
+ const auto acl_checklist = clientAclChecklistCreate(Config.accessList.store_id, http);
acl_checklist->nonBlockingCheck(clientStoreIdAccessCheckDone, this);
} else
storeIdStart(http, clientStoreIdDoneWrapper, this);
ClientRequestContext::checkNoCache()
{
if (Config.accessList.noCache) {
- acl_checklist = clientAclChecklistCreate(Config.accessList.noCache, http);
+ const auto acl_checklist = clientAclChecklistCreate(Config.accessList.noCache, http);
acl_checklist->nonBlockingCheck(checkNoCacheDoneWrapper, this);
} else {
/* unless otherwise specified, we try to cache. */
void
ClientRequestContext::checkNoCacheDone(const Acl::Answer &answer)
{
- acl_checklist = nullptr;
if (answer.denied()) {
http->request->flags.disableCacheUse("a cache deny rule matched");
}
entry->ping_status = PING_DONE;
}
- if (acl_checklist) {
- debugs(44, DBG_IMPORTANT, "ERROR: Squid BUG: peer selector gone while waiting for a slow ACL");
- delete acl_checklist;
- }
-
HTTPMSGUNLOCK(request);
if (entry) {
void
PeerSelector::checkNeverDirectDone(const Acl::Answer answer)
{
- acl_checklist = nullptr;
debugs(44, 3, answer);
never_direct = answer;
switch (answer) {
void
PeerSelector::checkAlwaysDirectDone(const Acl::Answer answer)
{
- acl_checklist = nullptr;
debugs(44, 3, answer);
always_direct = answer;
switch (answer) {
/** check always_direct; */
const auto ch = new ACLFilledChecklist(Config.accessList.AlwaysDirect, request);
ch->al = al;
- acl_checklist = ch;
- acl_checklist->syncAle(request, nullptr);
- acl_checklist->nonBlockingCheck(CheckAlwaysDirectDone, this);
+ ch->syncAle(request, nullptr);
+ ch->nonBlockingCheck(CheckAlwaysDirectDone, this);
return;
} else if (never_direct == ACCESS_DUNNO) {
debugs(44, 3, "direct = " << DirectStr[direct] << " (never_direct to be checked)");
/** check never_direct; */
const auto ch = new ACLFilledChecklist(Config.accessList.NeverDirect, request);
ch->al = al;
- acl_checklist = ch;
- acl_checklist->syncAle(request, nullptr);
- acl_checklist->nonBlockingCheck(CheckNeverDirectDone, this);
+ ch->syncAle(request, nullptr);
+ ch->nonBlockingCheck(CheckNeverDirectDone, this);
return;
} else if (request->flags.noDirect) {
/** if we are accelerating, direct is not an option. */
closest_parent_miss(),
hit(nullptr),
hit_type(PEER_NONE),
- acl_checklist (nullptr),
initiator_(initiator)
{
; // no local defaults.