]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ext_session_acl: cope with new logformat inputs
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 4 May 2017 10:12:39 +0000 (22:12 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 4 May 2017 10:12:39 +0000 (22:12 +1200)
Now that Squid is sending an explicit '-' for the trailing %DATA parameter
if there were no acl parameters this helper needs to cope with it on
'active mode' session lookups when login/logout are not being performed.

src/acl/external/session/ext_session_acl.cc

index 09ff1633ca7338994f4ec5a533a9d4eb43bb110e..bd023bd13ad0e22830d815e1141a524fb36bfd92 100644 (file)
@@ -210,6 +210,11 @@ int main(int argc, char **argv)
                 action = -1;
                 detail_len = (size_t)(lastdetail-detail);
                 *lastdetail = '\0';
+            } else if (!default_action && strcmp(lastdetail, " -") == 0) {
+                // no action; LOGIN/LOGOUT not supplied
+                // but truncate the '-' %DATA value given by Squid-4 and later
+                detail_len = (size_t)(lastdetail-detail);
+                *lastdetail = '\0';
             }
         }
         if (action == -1) {