From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 8 Sep 2024 11:32:35 +0000 (+0200)
Subject: normalize_lws(): Only log the 'Reducing whitespace ...' message once per header
X-Git-Tag: v_4_0_0~60^2~7
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/user-manual/@proxy-info-url@?a=commitdiff_plain;h=cdcb2605730e5664879773558f279251d6a0075d;p=privoxy.git

normalize_lws(): Only log the 'Reducing whitespace ...' message once per header
---

diff --git a/parsers.c b/parsers.c
index 1cb46dfe..a14f970d 100644
--- a/parsers.c
+++ b/parsers.c
@@ -903,6 +903,7 @@ jb_err decompress_iob(struct client_state *csp)
 static void normalize_lws(char *header)
 {
    char *p = header;
+   int reducing_white_space_message_logged = 0;
 
    while (*p != '\0')
    {
@@ -914,7 +915,11 @@ static void normalize_lws(char *header)
          {
             q++;
          }
-         log_error(LOG_LEVEL_HEADER, "Reducing whitespace in '%s'", header);
+         if (!reducing_white_space_message_logged)
+         {
+            log_error(LOG_LEVEL_HEADER, "Reducing whitespace in '%s'", header);
+            reducing_white_space_message_logged = 1;
+         }
          string_move(p+1, q);
       }