From 4187820e052524e86ac3b83b8b715780c30f39dd Mon Sep 17 00:00:00 2001 From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:00:23 +0000 Subject: [PATCH] Extend cache_log_message to problematic from-helper annotations (#1481) WARNING: Unsupported or unexpected from-helper annotation with a name reserved for Squid use The above message is emitted for every helper response containing problematic annotations. Let admins control this reporting using cache_log_message directive and message id 69. --- doc/debug-messages.dox | 1 + src/debug/Messages.h | 2 +- src/helper/Reply.cc | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/debug-messages.dox b/doc/debug-messages.dox index c5db63c9f7..08c9b48be0 100644 --- a/doc/debug-messages.dox +++ b/doc/debug-messages.dox @@ -66,5 +66,6 @@ ID Message gist 66 WARNING: BCP 177 violation. Detected non-functional IPv6 loopback. 67 WARNING: BCP 177 violation. IPv6 transport forced OFF by build parameters. 68 Processing Configuration File: ... (depth ...) +69 WARNING: Unsupported or unexpected from-helper annotation with a name reserved for Squid use: ...advice: If this is a custom annotation, rename it to add a trailing underscore: ... \endverbatim */ diff --git a/src/debug/Messages.h b/src/debug/Messages.h index c7b0c06e5d..24bc67235f 100644 --- a/src/debug/Messages.h +++ b/src/debug/Messages.h @@ -61,7 +61,7 @@ private: }; /// The maximum used DebugMessage::id plus 1. Increase as you add new IDs. -constexpr DebugMessageId DebugMessageIdUpperBound = 69; +constexpr DebugMessageId DebugMessageIdUpperBound = 70; /// a collection of DebugMessage objects (with fast access by message IDs) class DebugMessages diff --git a/src/helper/Reply.cc b/src/helper/Reply.cc index 4282533399..083672cfa7 100644 --- a/src/helper/Reply.cc +++ b/src/helper/Reply.cc @@ -10,6 +10,7 @@ #include "squid.h" #include "ConfigParser.h" +#include "debug/Messages.h" #include "debug/Stream.h" #include "helper.h" #include "helper/Reply.h" @@ -197,7 +198,7 @@ Helper::Reply::CheckReceivedKey(const SBuf &key, const SBuf &value) if (std::find(recognized.begin(), recognized.end(), key) != recognized.end()) return; // a Squid-recognized key - debugs(84, DBG_IMPORTANT, "WARNING: Unsupported or unexpected from-helper annotation with a name reserved for Squid use: " << + debugs(84, Important(69), "WARNING: Unsupported or unexpected from-helper annotation with a name reserved for Squid use: " << key << '=' << value << Debug::Extra << "advice: If this is a custom annotation, rename it to add a trailing underscore: " << key << '_'); -- 2.47.2