]> git.pld-linux.org Git - packages/lighttpd.git/commitdiff
- make encodings_arr local
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 19 Sep 2008 14:21:18 +0000 (14:21 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    lighttpd-mod_compress-disable-bzip2.patch -> 1.7

lighttpd-mod_compress-disable-bzip2.patch

index 031d3b93c27306438e3fb31aae7b3304f23f2209..44b4b29e8d83a3139dbefc241a981ac64af813fa 100644 (file)
@@ -1,6 +1,6 @@
 --- lighttpd-1.4.19/src/mod_compress.c 2008-09-19 14:16:06.292324544 +0300
-+++ lighttpd-1.4.19/src/mod_compress.c 2008-09-19 14:16:06.292324544 +0300
-@@ -49,12 +49,14 @@
++++ lighttpd-1.4.19/src/mod_compress.c 2008-09-19 17:08:15.821157844 +0300
+@@ -49,6 +49,7 @@
        buffer *compress_cache_dir;
        array  *compress;
        off_t   compress_max_filesize; /** max filesize in kb */
@@ -8,22 +8,7 @@
  } plugin_config;
  
  typedef struct {
-       PLUGIN_DATA;
-       buffer *ofn;
-       buffer *b;
-+      array  *encodings_arr;
-       plugin_config **config_storage;
-       plugin_config conf;
-@@ -67,6 +69,7 @@
-       p->ofn = buffer_init();
-       p->b = buffer_init();
-+      p->encodings_arr = array_init();
-       return p;
- }
-@@ -154,6 +157,7 @@
+@@ -154,6 +155,7 @@
                { "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 },
                { NULL,                             NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
        };
  
-@@ -166,10 +170,12 @@
+@@ -161,15 +163,18 @@
+       for (i = 0; i < srv->config_context->used; i++) {
+               plugin_config *s;
++              array  *encodings_arr = array_init();
+               s = calloc(1, sizeof(plugin_config));
                s->compress_cache_dir = buffer_init();
                s->compress = array_init();
                s->compress_max_filesize = 0;
                cv[0].destination = s->compress_cache_dir;
                cv[1].destination = s->compress;
                cv[2].destination = &(s->compress_max_filesize);
-+              cv[3].destination = p->encodings_arr; /* temp array for allowed encodings list */
++              cv[3].destination = encodings_arr; /* temp array for allowed encodings list */
  
                p->config_storage[i] = s;
  
-@@ -177,6 +183,32 @@
+@@ -177,6 +182,33 @@
                        return HANDLER_ERROR;
                }
  
-+              if (p->encodings_arr->used) {
++              if (encodings_arr->used) {
 +                      size_t j = 0;
-+                      for (j = 0; j < p->encodings_arr->used; j++) {
-+                              data_string *ds = (data_string *)p->encodings_arr->data[j];
++                      for (j = 0; j < encodings_arr->used; j++) {
++                              data_string *ds = (data_string *)encodings_arr->data[j];
 +#ifdef USE_ZLIB
 +                              if (NULL != strstr(ds->value->ptr, "gzip"))
 +                                      s->allowed_encodings |= HTTP_ACCEPT_ENCODING_GZIP;
@@ -73,6 +64,7 @@
 +                              HTTP_ACCEPT_ENCODING_DEFLATE | HTTP_ACCEPT_ENCODING_COMPRESS | HTTP_ACCEPT_ENCODING_BZIP2;
 +              }
 +
++              array_free(encodings_arr);
 +
                if (!buffer_is_empty(s->compress_cache_dir)) {
                        struct stat st;
This page took 0.193895 seconds and 4 git commands to generate.