Skip to content

Commit

Permalink
Remove global AclMatchedName from ACL::match() virtual methods (squid…
Browse files Browse the repository at this point in the history
…-cache#1594)

... and use ACL::name instead, which became accessible since 8319d47.
  • Loading branch information
eduard-bagdasaryan authored and squid-anubis committed Nov 25, 2023
1 parent 877e36d commit 8dc91e6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/acl/Asn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ Acl::DestinationAsnCheck::match(ACLChecklist * const ch)

} else if (!checklist->request->flags.destinationIpLookedUp) {
/* No entry in cache, lookup not attempted */
debugs(28, 3, "can't yet compare '" << AclMatchedName << "' ACL for " << checklist->request->url.host());
debugs(28, 3, "can't yet compare '" << name << "' ACL for " << checklist->request->url.host());
if (checklist->goAsync(ACLDestinationIP::StartLookup, *this))
return -1;
// else fall through to noaddr match, hiding the lookup failure (XXX)
Expand Down
7 changes: 3 additions & 4 deletions src/acl/DestinationDomain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Acl::DestinationDomainCheck::match(ACLChecklist * const ch)
}

if (lookupBanned) {
debugs(28, 3, "No-lookup DNS ACL '" << AclMatchedName << "' for " << checklist->request->url.host());
debugs(28, 3, "No-lookup DNS ACL '" << name << "' for " << checklist->request->url.host());
return 0;
}

Expand All @@ -67,7 +67,7 @@ Acl::DestinationDomainCheck::match(ACLChecklist * const ch)

/* do we already have the rDNS? match on it if we do. */
if (checklist->dst_rdns) {
debugs(28, 3, "'" << AclMatchedName << "' match with stored rDNS '" << checklist->dst_rdns << "' for " << checklist->request->url.host());
debugs(28, 3, "'" << name << "' match with stored rDNS '" << checklist->dst_rdns << "' for " << checklist->request->url.host());
return data->match(checklist->dst_rdns);
}

Expand All @@ -84,8 +84,7 @@ Acl::DestinationDomainCheck::match(ACLChecklist * const ch)
checklist->dst_rdns = xstrdup(fqdn);
return data->match(fqdn);
} else if (!checklist->destinationDomainChecked()) {
// TODO: Using AclMatchedName here is not OO correct. Should find a way to the current acl
debugs(28, 3, "Can't yet compare '" << AclMatchedName << "' ACL for " << checklist->request->url.host());
debugs(28, 3, "Can't yet compare '" << name << "' ACL for " << checklist->request->url.host());
if (checklist->goAsync(StartLookup, *this))
return -1;
// else fall through to "none" match, hiding the lookup failure (XXX)
Expand Down
2 changes: 1 addition & 1 deletion src/acl/DestinationIp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ACLDestinationIP::match(ACLChecklist *cl)

if (lookupBanned) {
if (!checklist->request->url.hostIsNumeric()) {
debugs(28, 3, "No-lookup DNS ACL '" << AclMatchedName << "' for " << checklist->request->url.host());
debugs(28, 3, "No-lookup DNS ACL '" << name << "' for " << checklist->request->url.host());
return 0;
}

Expand Down
3 changes: 1 addition & 2 deletions src/acl/SourceDomain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ Acl::SourceDomainCheck::match(ACLChecklist * const ch)
if (fqdn) {
return data->match(fqdn);
} else if (!checklist->sourceDomainChecked()) {
// TODO: Using AclMatchedName here is not OO correct. Should find a way to the current acl
debugs(28, 3, "aclMatchAcl: Can't yet compare '" << AclMatchedName << "' ACL for '" << checklist->src_addr << "'");
debugs(28, 3, "aclMatchAcl: Can't yet compare '" << name << "' ACL for '" << checklist->src_addr << "'");
if (checklist->goAsync(StartLookup, *this))
return -1;
// else fall through to "none" match, hiding the lookup failure (XXX)
Expand Down

0 comments on commit 8dc91e6

Please sign in to comment.