From dab2bf8b1599ac1b5db4e69e832ce22dffe78b54 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Thu, 12 Apr 2007 12:53:58 +0000
Subject: [PATCH] Log a warning if the content is compressed, filtering is
 enabled and Privoxy was compiled without zlib support. Closes FR#1673938.

---
 parsers.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/parsers.c b/parsers.c
index 2723a907..cf2eea8f 100644
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.94 2007/03/21 12:23:53 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.95 2007/03/25 14:26:40 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -44,6 +44,14 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.94 2007/03/21 12:23:53 fabiankeil
  *
  * Revisions   :
  *    $Log: parsers.c,v $
+ *    Revision 1.95  2007/03/25 14:26:40  fabiankeil
+ *    - Fix warnings when compiled with glibc.
+ *    - Don't use crumble() for cookie crunching.
+ *    - Move cookie time parsing into parse_header_time().
+ *    - Let parse_header_time() return a jb_err code
+ *      instead of a pointer that can only be used to
+ *      check for NULL anyway.
+ *
  *    Revision 1.94  2007/03/21 12:23:53  fabiankeil
  *    - Add better protection against malicious gzip headers.
  *    - Stop logging the first hundred bytes of decompressed content.
@@ -1975,8 +1983,20 @@ jb_err server_content_encoding(struct client_state *csp, char **header)
        * Body is compressed, turn off pcrs and gif filtering.
        */
       csp->content_type |= CT_TABOO;
+
+      /*
+       * Log a warning if the user expects the content to be filtered.
+       */
+      if ((csp->rlist != NULL) &&
+         (!list_is_empty(csp->action->multi[ACTION_MULTI_FILTER])))
+      {
+         log_error(LOG_LEVEL_INFO,
+            "Compressed content detected, content filtering disabled. "
+            "Consider recompiling Privoxy with zlib support or "
+            "enable the prevent-compression action.");
+      }
    }
-#endif /* !defined(FEATURE_ZLIB) */
+#endif /* defined(FEATURE_ZLIB) */
 
    return JB_ERR_OK;
 
-- 
2.49.0