Acl::AnnotateClientCheck::match(ACLChecklist * const ch)
{
const auto checklist = Filled(ch);
+ auto annotated = false;
+ const auto tdata = dynamic_cast<ACLAnnotationData*>(data.get());
+ assert(tdata);
+ const auto conn = checklist->conn();
- if (const auto conn = checklist->conn()) {
- const auto tdata = dynamic_cast<ACLAnnotationData*>(data.get());
- assert(tdata);
+ if (conn) {
tdata->annotate(conn->notes(), &delimiters.value, checklist->al);
- if (const auto request = checklist->request)
- tdata->annotate(request->notes(), &delimiters.value, checklist->al);
- return 1;
+ annotated = true;
}
- return 0;
+
+ if (const auto &request = checklist->request) {
+ tdata->annotate(request->notes(), &delimiters.value, checklist->al);
+ annotated = true;
+ } else if (conn && !conn->pipeline.empty()) {
+ debugs(28, DBG_IMPORTANT, "ERROR: Squid BUG: " << name << " ACL is used in context with " <<
+ "an unexpectedly nil ACLFilledChecklist::request. Did not annotate the current transaction.");
+ }
+
+ if (!annotated) {
+ debugs(28, DBG_IMPORTANT, "WARNING: " << name << " ACL is used in context without " <<
+ "active client-to-Squid connection and current transaction information. Did not annotate.");
+ }
+
+ return 1; // this is an "always matching" ACL
}
const auto tdata = dynamic_cast<ACLAnnotationData*>(data.get());
assert(tdata);
tdata->annotate(request->notes(), &delimiters.value, checklist->al);
- return 1;
+ } else {
+ debugs(28, DBG_IMPORTANT, "WARNING: " << name << " ACL is used in context without " <<
+ "current transaction information. Did not annotate.");
}
- return 0;
+ return 1; // this is an "always matching" ACL
}