From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 3 Jul 2011 17:55:23 +0000 (+0000)
Subject: Move LOWER_LENGTH_LIMIT_FOR_COMPRESSION into cgi.[ch] where it belongs
X-Git-Tag: v_3_0_18~185
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/@default-cgi@/@default-cgi@show-url-info?a=commitdiff_plain;h=e866a10d8d231d1ad35362b0d3a95b0aced40c19;p=privoxy.git

Move LOWER_LENGTH_LIMIT_FOR_COMPRESSION into cgi.[ch] where it belongs

While at it, turn it into a proper variable so it can be changed from the debugger.
---

diff --git a/cgi.c b/cgi.c
index b185f491..86553664 100644
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-const char cgi_rcs[] = "$Id: cgi.c,v 1.135 2011/06/29 18:36:49 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.136 2011/07/03 17:54:29 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgi.c,v $
@@ -271,6 +271,13 @@ const char image_blank_data[] =
 const size_t image_pattern_length = sizeof(image_pattern_data) - 1;
 const size_t image_blank_length   = sizeof(image_blank_data) - 1;
 
+#ifdef FEATURE_COMPRESSION
+/*
+ * Minimum length which a buffer has to reach before
+ * we bother to (re-)compress it. Completely arbitrary.
+ */
+const size_t LOWER_LENGTH_LIMIT_FOR_COMPRESSION = 1024U;
+#endif
 
 static struct http_response cgi_error_memory_response[1];
 
diff --git a/cgi.h b/cgi.h
index 4cd21fcf..91cd0f8a 100644
--- a/cgi.h
+++ b/cgi.h
@@ -1,6 +1,6 @@
 #ifndef CGI_H_INCLUDED
 #define CGI_H_INCLUDED
-#define CGI_H_VERSION "$Id: cgi.h,v 1.37 2009/06/11 11:44:25 fabiankeil Exp $"
+#define CGI_H_VERSION "$Id: cgi.h,v 1.38 2011/06/23 14:01:01 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgi.h,v $
@@ -102,6 +102,11 @@ extern jb_err get_string_param(const struct map *parameters,
 extern char   get_char_param(const struct map *parameters,
                              const char *param_name);
 #ifdef FEATURE_COMPRESSION
+/*
+ * Minimum length which a buffer has to reach before
+ * we bother to (re-)compress it. Completely arbitrary.
+ */
+extern const size_t LOWER_LENGTH_LIMIT_FOR_COMPRESSION;
 extern char *compress_buffer(char *buffer, size_t *buffer_length);
 #endif
 
diff --git a/project.h b/project.h
index 4eb89089..cbd548a9 100644
--- a/project.h
+++ b/project.h
@@ -187,12 +187,6 @@ typedef int jb_err;
  */
 #define CGI_PARAM_LEN_MAX 500U
 
-/**
- * Minimum length which a buffer has to reach before
- * Privoxy bothers to (re-)compress it. Completely arbitrary.
- */
-#define LOWER_LENGTH_LIMIT_FOR_COMPRESSION 1024U
-
 /**
  * Buffer size for capturing struct hostent data in the
  * gethostby(name|addr)_r library calls. Since we don't