If zlib support is unavailable and there are content filters active
[privoxy.git] / cgisimple.c
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);