From: Christos Tsantilas Date: Thu, 12 Mar 2020 17:21:46 +0000 (+0200) Subject: Supply ALE to request_header_add/reply_header_add (#564) X-Git-Tag: SQUID_4_11~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37e1096f23df5cffb48c496600e3d2b415c57bcc;p=thirdparty%2Fsquid.git Supply ALE to request_header_add/reply_header_add (#564) 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. --- diff --git a/src/HttpHeaderTools.cc b/src/HttpHeaderTools.cc index f7a66fb647..5b757144ff 100644 --- a/src/HttpHeaderTools.cc +++ b/src/HttpHeaderTools.cc @@ -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;