]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
external_acl parameters separated by %20 instead of space
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 19 Feb 2016 17:19:25 +0000 (19:19 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 19 Feb 2016 17:19:25 +0000 (19:19 +0200)
If an external ACL is configured with more than one parameter as shown
in the example below, then Squid sends those parameters to the
external_acl helper separated by %20 characters instead of spaces:

  acl TEST external ACLTYPE param1=val1 param2=val2

This change fixes regression introduced in trunk r14351 (Support
logformat %macros in external_acl_type format) but more work may
be needed to make Squid behave as squid.conf.documented promises.

This is a Measurement Factory project.

src/cf.data.pre
src/external_acl.cc

index dfe482b14b84abf7f0633b1293a6182c82be6de8..bd66346231befa3d42674921b864e82a97112d23 100644 (file)
@@ -712,7 +712,7 @@ DOC_START
        This option defines external acl classes using a helper program
        to look up the status
 
-         external_acl_type name [options] FORMAT.. /path/to/helper [helper arguments..]
+         external_acl_type name [options] FORMAT /path/to/helper [helper arguments]
 
        Options:
 
@@ -774,13 +774,18 @@ DOC_START
 
          %ACL          The name of the ACL being tested.
 
-         %DATA         The ACL arguments. If a logformat encoding modifier
-                       is used it will encode the whole set of arguments
-                       as a single token.
+         %DATA         The ACL arguments separated by spaces (an
+                       "argument string").
 
-                       If not used; then any arguments are automatically
-                       added at the end of the line sent to the helper
-                       as separately URL-encoded fields.
+                       By default, Squid applies URL-encoding to each ACL
+                       argument inside the argument string. If an explicit
+                       encoding modifier is used (e.g., %#DATA), then Squid
+                       encodes the whole argument string as a single token
+                       (e.g., with %#DATA, spaces between arguments become
+                       %20).
+
+                       If you do not specify a DATA macro inside FORMAT,
+                       Squid automatically appends %DATA to your FORMAT.
 
        If SSL is enabled, the following formating codes become available:
 
index 952e69d0d91ee8da165e34f323350d4ecd0afaec..9671129988c90d4dfdae54d566eeb3a651390b39 100644 (file)
@@ -326,7 +326,7 @@ parse_externalAclHelper(external_acl ** list)
     if (!data_used) {
         *fmt = new Format::Token;
         (*fmt)->type = Format::LFT_EXT_ACL_DATA;
-        (*fmt)->quote = Format::LOG_QUOTE_URL;
+        (*fmt)->quote = Format::LOG_QUOTE_NONE;
     }
 
     /* helper */