]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Supply ALE to request_header_add/reply_header_add (#564)
authorChristos Tsantilas <christos@chtsanti.net>
Thu, 12 Mar 2020 17:21:46 +0000 (19:21 +0200)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 13 Mar 2020 22:18:39 +0000 (11:18 +1300)
Supply ALE to request_header_add and reply_header_add ACLs that need it
(e.g., external, annotate_client, and annotate_transaction ACLs). Fixes
"ACL is used in context without an ALE state" errors when external ACLs
are used in the same context (other ACLs do not yet properly disclose
that they need ALE).

Also provides HTTP reply to reply_header_add ACLs.

This is a Measurement Factory project.

src/HttpHeaderTools.cc

index f7a66fb6477251374080d040eccb5ca54abb4a01..5b757144ffb1c25ed40e47a4eb5a0b953c1b50f2 100644 (file)
@@ -477,6 +477,12 @@ httpHdrAdd(HttpHeader *heads, HttpRequest *request, const AccessLogEntryPointer
 {
     ACLFilledChecklist checklist(NULL, request, NULL);
 
+    checklist.al = al;
+    if (al && al->reply) {
+        checklist.reply = al->reply;
+        HTTPMSGLOCK(checklist.reply);
+    }
+
     for (HeaderWithAclList::const_iterator hwa = headersAdd.begin(); hwa != headersAdd.end(); ++hwa) {
         if (!hwa->aclList || checklist.fastCheck(hwa->aclList).allowed()) {
             const char *fieldValue = NULL;