]> git.pld-linux.org Git - packages/lighttpd.git/blob - lighttpd-mod_compress-disable-bzip2.patch
- patch to disable bzip2 from config
[packages/lighttpd.git] / lighttpd-mod_compress-disable-bzip2.patch
1 --- lighttpd-1.4.19/src/mod_compress.c~ 2008-09-19 13:00:02.000000000 +0300
2 +++ lighttpd-1.4.19/src/mod_compress.c  2008-09-19 13:24:30.921429633 +0300
3 @@ -46,6 +46,7 @@
4  #endif
5  
6  typedef struct {
7 +       unsigned short  bzip2;
8         buffer *compress_cache_dir;
9         array  *compress;
10         off_t   compress_max_filesize; /** max filesize in kb */
11 @@ -154,6 +155,7 @@
12                 { "compress.cache-dir",             NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION },
13                 { "compress.filetype",              NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },
14                 { "compress.max-filesize",          NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },
15 +               { "compress.bzip2",                 NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
16                 { NULL,                             NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
17         };
18  
19 @@ -166,10 +168,12 @@
20                 s->compress_cache_dir = buffer_init();
21                 s->compress = array_init();
22                 s->compress_max_filesize = 0;
23 +               s->bzip2 = 1;
24  
25                 cv[0].destination = s->compress_cache_dir;
26                 cv[1].destination = s->compress;
27                 cv[2].destination = &(s->compress_max_filesize);
28 +               cv[3].destination = &(s->bzip2);
29  
30                 p->config_storage[i] = s;
31  
32 @@ -587,6 +591,7 @@
33         PATCH(compress_cache_dir);
34         PATCH(compress);
35         PATCH(compress_max_filesize);
36 +       PATCH(bzip2);
37  
38         /* skip the first, the global context */
39         for (i = 1; i < srv->config_context->used; i++) {
40 @@ -606,6 +611,8 @@
41                                 PATCH(compress);
42                         } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.max-filesize"))) {
43                                 PATCH(compress_max_filesize);
44 +                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.bzip2"))) {
45 +                               PATCH(bzip2);
46                         }
47                 }
48         }
49 @@ -675,12 +682,18 @@
50                                 if (NULL != strstr(value, "gzip")) accept_encoding |= HTTP_ACCEPT_ENCODING_GZIP;
51                                 if (NULL != strstr(value, "deflate")) accept_encoding |= HTTP_ACCEPT_ENCODING_DEFLATE;
52                                 if (NULL != strstr(value, "compress")) accept_encoding |= HTTP_ACCEPT_ENCODING_COMPRESS;
53 -                               if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2;
54 +#ifdef USE_BZ2LIB
55 +                               if (p->conf.bzip2) {
56 +                                       if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2;
57 +                               }
58 +#endif
59                                 if (NULL != strstr(value, "identity")) accept_encoding |= HTTP_ACCEPT_ENCODING_IDENTITY;
60  
61                                 /* get server side supported ones */
62  #ifdef USE_BZ2LIB
63 -                               srv_encodings |= HTTP_ACCEPT_ENCODING_BZIP2;
64 +                               if (p->conf.bzip2) {
65 +                                       srv_encodings |= HTTP_ACCEPT_ENCODING_BZIP2;
66 +                               }
67  #endif
68  #ifdef USE_ZLIB
69                                 srv_encodings |= HTTP_ACCEPT_ENCODING_GZIP;
70 --- lighttpd-1.4.19/doc/compress.txt~   2006-10-04 16:26:23.000000000 +0300
71 +++ lighttpd-1.4.19/doc/compress.txt    2008-09-19 13:27:27.571638906 +0300
72 @@ -32,6 +32,9 @@
73  Options
74  =======
75  
76 +compress.bzip2
77 +  enable/disable bzip2 support.
78 +
79  compress.cache-dir
80    name of the directory where compressed content will be cached
81  
This page took 0.031877 seconds and 3 git commands to generate.