]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Extend cache_log_message to problematic from-helper annotations (#1481)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Mon, 18 Sep 2023 15:00:23 +0000 (15:00 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Wed, 20 Sep 2023 16:58:25 +0000 (04:58 +1200)
    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
src/debug/Messages.h
src/helper/Reply.cc

index c5db63c9f7a5cde0222e93e95bafe557016b2e11..08c9b48be06b6bf066594c9e9d13ba4f42e2a64a 100644 (file)
@@ -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
 */
index c7b0c06e5d2f6c98a3d3d0d6ac39f6707fb88fba..24bc67235f14fa287e754a1b8696436cf7a4f550 100644 (file)
@@ -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
index 4282533399d14755cd62d8583350202251979341..083672cfa73fe7923df84bdbbc50d3c00e5fa74e 100644 (file)
@@ -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 << '_');