]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix missing external ACL helper notes
authorNathan Hoad <nathan@getoffmalawn.com>
Fri, 22 May 2015 04:26:17 +0000 (21:26 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 22 May 2015 04:26:17 +0000 (21:26 -0700)
external ACL helper notes are only added onto the HTTP request that
kicked off the external ACL lookup, and not cached ACL responses.
This means if you set notes from an external ACL that are used for
some processing in other ACLs, or post-processing on logs, things
may be missed.

src/external_acl.cc

index 6157200ea37de651207c3cb5751e1e93f66751b0..9892dcd33e2176b7bccf1e1cdb6ed268839205ed 100644 (file)
@@ -706,6 +706,9 @@ copyResultsFromEntry(HttpRequest *req, const ExternalACLEntryPointer &entry)
 
         if (entry->message.size())
             req->extacl_message = entry->message;
+
+        // attach the helper kv-pair to the transaction
+        UpdateRequestNotes(req->clientConnectionManager.get(), *req, entry->notes);
     }
 }
 
@@ -1532,18 +1535,6 @@ ExternalACLLookup::LookupDone(void *data, const ExternalACLEntryPointer &result)
 {
     ACLFilledChecklist *checklist = Filled(static_cast<ACLChecklist*>(data));
     checklist->extacl_entry = result;
-
-    // attach the helper kv-pair to the transaction
-    if (checklist->extacl_entry != NULL) {
-        if (HttpRequest * req = checklist->request) {
-            // XXX: we have no access to the transaction / AccessLogEntry so cant SyncNotes().
-            // workaround by using anything already set in HttpRequest
-            // OR use new and rely on a later Sync copying these to AccessLogEntry
-
-            UpdateRequestNotes(checklist->conn(), *req, checklist->extacl_entry->notes);
-        }
-    }
-
     checklist->resumeNonBlockingCheck(ExternalACLLookup::Instance());
 }