Log a warning if the content is compressed, filtering is
authorFabian Keil <fk@fabiankeil.de>
Thu, 12 Apr 2007 12:53:58 +0000 (12:53 +0000)
committerFabian Keil <fk@fabiankeil.de>
Thu, 12 Apr 2007 12:53:58 +0000 (12:53 +0000)
enabled and Privoxy was compiled without zlib support.
Closes FR#1673938.

parsers.c

index 2723a90..cf2eea8 100644 (file)
--- 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 $
 /*********************************************************************
  *
  * 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 $
  *
  * 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.
  *    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;
        * 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;
 
 
    return JB_ERR_OK;