If zlib support is unavailable and there are content filters active
authorFabian Keil <fk@fabiankeil.de>
Sat, 26 Apr 2008 10:34:18 +0000 (10:34 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sat, 26 Apr 2008 10:34:18 +0000 (10:34 +0000)
but the prevent-compression action is disabled, include a warning
on the show-url-info page that compression might prevent filtering.

ChangeLog
cgisimple.c
templates/show-url-info

index 950fb79..9e167d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,10 @@ ChangeLog for Privoxy
   interesting if you are using large action files or regularly use
   Privoxy-Regression-Test while running Privoxy through Valgrind,
   for stock configuration files it doesn't really matter.
+- If zlib support is unavailable and there are content
+  filters active but the prevent-compression action is disabled,
+  the show-url-info page includes a warning that compression
+  might prevent filtering.
 - The obsolete kill-popups action has been removed as the
   PCRS-based popup filters can do the same and are less
   unreliable.
index 9cc2339..2ea674e 100644 (file)
@@ -1,4 +1,4 @@
-const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.70 2008/04/24 16:12:38 fabiankeil Exp $";
+const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.71 2008/04/25 13:33:56 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgisimple.c,v $
@@ -36,6 +36,10 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.70 2008/04/24 16:12:38 fabian
  *
  * Revisions   :
  *    $Log: cgisimple.c,v $
+ *    Revision 1.71  2008/04/25 13:33:56  fabiankeil
+ *    - Factor cgi_show_file() out of cgi_show_status().
+ *    - Adjust cgi_show_status()'s parameter description to match reality.
+ *
  *    Revision 1.70  2008/04/24 16:12:38  fabiankeil
  *    In cgi_show_status(), load the requested file at once.
  *    Using string_join() for every line really doesn't scale.
@@ -1682,6 +1686,23 @@ jb_err cgi_show_url_info(struct client_state *csp,
       }
 #endif /* FEATURE_CGI_EDIT_ACTIONS */
 
+      /*
+       * If zlib support is available, if no content filters
+       * are enabled or if the prevent-compression action is enabled,
+       * suppress the "compression could prevent filtering" warning.
+       *
+       * XXX: Change content_filters_enabled()'s prototype so we can
+       * use it here.
+       */
+#ifndef FEATURE_ZLIB
+      if ((list_is_empty(action->multi[ACTION_MULTI_FILTER])
+             && !(action->flags & ACTION_DEANIMATE))
+         || (action->flags & ACTION_NO_COMPRESSION))
+#endif
+      {
+         if (!err) err = map_block_killer(exports, "filters-might-be-ineffective");
+      }
+
       if (err || map(exports, "matches", 1, matches , 0))
       {
          free_current_action(action);
index 06f4b94..4c168fb 100644 (file)
 #
 # Revisions   :
 #    $Log: show-url-info,v $
+#    Revision 1.24  2008/02/10 17:26:52  fabiankeil
+#    Reduce superfluous white space by not marking
+#    up the final results list as paragraph.
+#
 #    Revision 1.23  2008/02/01 06:04:31  fabiankeil
 #    If edit buttons on the show-url-info CGI page are hidden, explain why.
 #
 <!--  if-cgi-editor-is-disabled-end@ -->
       </td>
     </tr>
+<!-- @if-filters-might-be-ineffective-start -->
+    <tr>
+      <td class="warning">
+        <h2>Warning:</h2>
+        <p>
+          This Privoxy version has been build without zlib support,
+          <strong>content filters will not work if the server sends compressed content.</strong>
+          Consider enabling the <a title="prevent-compression documentation"
+           href="@user-manual@actions-file.html#PREVENT-COMPRESSION">prevent-compression</a>
+          action for this URL or rebuild Privoxy with zlib support.
+        </p>
+      </td>
+    </tr>
+<!-- if-filters-might-be-ineffective-end@ -->
 <!-- @if-valid-url-start -->
     <tr>
       <td class="box">