From: Amos Jeffries Date: Thu, 4 May 2017 10:12:39 +0000 (+1200) Subject: ext_session_acl: cope with new logformat inputs X-Git-Tag: SQUID_4_0_20~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b91fddffdc27184af7ee63d3952ff86073c36e5f;p=thirdparty%2Fsquid.git 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. --- 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) {