From 4b547ad7b4417bb111cd0c739531d07ca36586a5 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 1 May 2015 00:11:04 -0700 Subject: [PATCH] Fix 'access_log none' to prevent following logs being used The documented behaviour of "access_log none" for preventing logging using log lines following the directive has not been working in Squid-3 for some time. Since the 'none' type does not have a log module associated the entire switch logic where its abort is checked for was being skipped. --- src/log/access_log.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/log/access_log.cc b/src/log/access_log.cc index cb5af0eed9..9af426d8e1 100644 --- a/src/log/access_log.cc +++ b/src/log/access_log.cc @@ -118,6 +118,10 @@ accessLogLogTo(CustomLog* log, AccessLogEntry::Pointer &al, ACLChecklist * check if (log->aclList && checklist && checklist->fastCheck(log->aclList) != ACCESS_ALLOWED) continue; + // The special-case "none" type has no logfile object set + if (log->type == Log::Format::CLF_NONE) + return; + if (log->logfile) { logfileLineStart(log->logfile); @@ -153,9 +157,6 @@ accessLogLogTo(CustomLog* log, AccessLogEntry::Pointer &al, ACLChecklist * check break; #endif - case Log::Format::CLF_NONE: - return; // abort! - default: fatalf("Unknown log format %d\n", log->type); break; -- 2.47.2