---- lighttpd-1.4.19/src/mod_compress.c 2008-09-19 17:24:45.542342957 +0300
-+++ lighttpd-1.4.19/src/mod_compress.c 2008-09-22 14:24:00.738911820 +0300
+--- lighttpd-1.4.19/src/mod_compress.c 2008-09-22 14:24:00.738911820 +0300
++++ lighttpd-1.4.19/src/mod_compress.c 2008-09-22 16:24:49.930179728 +0300
@@ -49,6 +49,7 @@
buffer *compress_cache_dir;
array *compress;
} plugin_config;
typedef struct {
-@@ -154,6 +155,7 @@
+@@ -154,6 +155,8 @@
{ "compress.cache-dir", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
{ "compress.filetype", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
{ "compress.max-filesize", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
+ { "compress.allowed_encodings", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
++ { "compress.allowed-encodings", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
-@@ -161,15 +163,18 @@
+@@ -161,15 +164,19 @@
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
cv[1].destination = s->compress;
cv[2].destination = &(s->compress_max_filesize);
+ cv[3].destination = encodings_arr; /* temp array for allowed encodings list */
++ cv[4].destination = encodings_arr; /* temp array for allowed encodings list */
p->config_storage[i] = s;
-@@ -177,6 +182,39 @@
+@@ -177,6 +184,39 @@
return HANDLER_ERROR;
}
if (!buffer_is_empty(s->compress_cache_dir)) {
struct stat st;
mkdir_recursive(s->compress_cache_dir->ptr);
-@@ -587,6 +625,7 @@
+@@ -587,6 +627,7 @@
PATCH(compress_cache_dir);
PATCH(compress);
PATCH(compress_max_filesize);
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
-@@ -606,6 +645,8 @@
+@@ -606,6 +647,10 @@
PATCH(compress);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.max-filesize"))) {
PATCH(compress_max_filesize);
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.allowed_encodings"))) {
++ PATCH(allowed_encodings);
++ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.allowed-encodings"))) {
+ PATCH(allowed_encodings);
}
}
}
-@@ -668,27 +709,21 @@
+@@ -668,27 +713,21 @@
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Accept-Encoding"))) {
int accept_encoding = 0;
char *value = ds->value->ptr;
Options
=======
-+compress.allowed_encodings
++compress.allowed-encodings
+ override default set of allowed encodings
+
+ e.g.: ::
-+ compress.allowed_encodings = ("bzip2", "gzip", "deflate")
++ compress.allowed-encodings = ("bzip2", "gzip", "deflate")
+
compress.cache-dir
name of the directory where compressed content will be cached