From b91fddffdc27184af7ee63d3952ff86073c36e5f Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 4 May 2017 22:12:39 +1200 Subject: [PATCH] ext_session_acl: cope with new logformat inputs 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/acl/external/session/ext_session_acl.cc b/src/acl/external/session/ext_session_acl.cc index 09ff1633ca..bd023bd13a 100644 --- a/src/acl/external/session/ext_session_acl.cc +++ b/src/acl/external/session/ext_session_acl.cc @@ -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) { -- 2.47.2