Author: glen Date: Fri Sep 19 12:48:41 2008 GMT Module: SOURCES Tag: HEAD ---- Log message: - rediff and now compiles
---- Files affected: SOURCES: lighttpd-mod_compress-disable-bzip2.patch (1.4 -> 1.5) ---- Diffs: ================================================================ Index: SOURCES/lighttpd-mod_compress-disable-bzip2.patch diff -u SOURCES/lighttpd-mod_compress-disable-bzip2.patch:1.4 SOURCES/lighttpd-mod_compress-disable-bzip2.patch:1.5 --- SOURCES/lighttpd-mod_compress-disable-bzip2.patch:1.4 Fri Sep 19 13:35:24 2008 +++ SOURCES/lighttpd-mod_compress-disable-bzip2.patch Fri Sep 19 14:48:35 2008 @@ -1,75 +1,92 @@ --- lighttpd-1.4.19/src/mod_compress.c 2008-09-19 13:24:30.921429633 +0300 +++ lighttpd-1.4.19/src/mod_compress.c 2008-09-19 14:16:06.292324544 +0300 -@@ -46,6 +46,7 @@ - #endif - - typedef struct { -+ unsigned short bzip2; +@@ -49,12 +49,14 @@ buffer *compress_cache_dir; array *compress; off_t compress_max_filesize; /** max filesize in kb */ -@@ -154,6 +155,7 @@ ++ int allowed_encodings; + } plugin_config; + + typedef struct { + PLUGIN_DATA; + buffer *ofn; + buffer *b; ++ array *encodings_arr; + + plugin_config **config_storage; + plugin_config conf; +@@ -154,6 +156,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 }, -+ { "compress.bzip2", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, ++ { "compress.allowed_encodings", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET } }; -@@ -166,10 +168,12 @@ +@@ -166,10 +169,12 @@ s->compress_cache_dir = buffer_init(); s->compress = array_init(); s->compress_max_filesize = 0; -+ s->bzip2 = 1; ++ s->allowed_encodings = 0; cv[0].destination = s->compress_cache_dir; cv[1].destination = s->compress; cv[2].destination = &(s->compress_max_filesize); -+ cv[3].destination = &(s->bzip2); ++ cv[3].destination = p->encodings_arr; /* temp array for allowed encodings list */ p->config_storage[i] = s; -@@ -587,6 +591,7 @@ +@@ -177,6 +182,32 @@ + return HANDLER_ERROR; + } + ++ if (p->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]; ++#ifdef USE_ZLIB ++ if (NULL != strstr(ds->value->ptr, "gzip")) ++ s->allowed_encodings |= HTTP_ACCEPT_ENCODING_GZIP; ++ if (NULL != strstr(ds->value->ptr, "deflate")) ++ s->allowed_encodings |= HTTP_ACCEPT_ENCODING_DEFLATE; ++#endif ++ /* ++ if (NULL != strstr(ds->value->ptr, "compress")) ++ s->allowed_encodings |= HTTP_ACCEPT_ENCODING_COMPRESS; ++ */ ++#ifdef USE_BZ2LIB ++ if (NULL != strstr(ds->value->ptr, "bzip2")) ++ s->allowed_encodings |= HTTP_ACCEPT_ENCODING_BZIP2; ++#endif ++ } ++ } else { ++ /* default encodings */ ++ s->allowed_encodings = HTTP_ACCEPT_ENCODING_IDENTITY | HTTP_ACCEPT_ENCODING_GZIP | ++ HTTP_ACCEPT_ENCODING_DEFLATE | HTTP_ACCEPT_ENCODING_COMPRESS | HTTP_ACCEPT_ENCODING_BZIP2; ++ } ++ ++ + if (!buffer_is_empty(s->compress_cache_dir)) { + struct stat st; + mkdir_recursive(s->compress_cache_dir->ptr); +@@ -587,6 +618,7 @@ PATCH(compress_cache_dir); PATCH(compress); PATCH(compress_max_filesize); -+ PATCH(bzip2); ++ PATCH(allowed_encodings); /* skip the first, the global context */ for (i = 1; i < srv->config_context->used; i++) { -@@ -606,6 +611,8 @@ +@@ -606,6 +638,8 @@ 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.bzip2"))) { -+ PATCH(bzip2); ++ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("compress.allowed_encodings"))) { ++ PATCH(allowed_encodings); } } } -@@ -675,12 +682,18 @@ - if (NULL != strstr(value, "gzip")) accept_encoding |= HTTP_ACCEPT_ENCODING_GZIP; - if (NULL != strstr(value, "deflate")) accept_encoding |= HTTP_ACCEPT_ENCODING_DEFLATE; - if (NULL != strstr(value, "compress")) accept_encoding |= HTTP_ACCEPT_ENCODING_COMPRESS; -- if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2; -+#ifdef USE_BZ2LIB -+ if (p->conf.bzip2) { -+ if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2; -+ } -+#endif - if (NULL != strstr(value, "identity")) accept_encoding |= HTTP_ACCEPT_ENCODING_IDENTITY; - - /* get server side supported ones */ - #ifdef USE_BZ2LIB -- srv_encodings |= HTTP_ACCEPT_ENCODING_BZIP2; -+ if (p->conf.bzip2) { -+ srv_encodings |= HTTP_ACCEPT_ENCODING_BZIP2; -+ } - #endif - #ifdef USE_ZLIB - srv_encodings |= HTTP_ACCEPT_ENCODING_GZIP; ---- lighttpd-1.4.19/src/mod_compress.c~ 2008-09-19 14:25:16.000000000 +0300 -+++ lighttpd-1.4.19/src/mod_compress.c 2008-09-19 14:27:32.251960154 +0300 -@@ -675,7 +675,6 @@ +@@ -668,27 +702,19 @@ if (NULL != (ds = (data_string *)array_get_element(con->request.headers, "Accept-Encoding"))) { int accept_encoding = 0; char *value = ds->value->ptr; @@ -77,28 +94,23 @@ int matched_encodings = 0; /* get client side support encodings */ -@@ -683,25 +682,12 @@ + if (NULL != strstr(value, "gzip")) accept_encoding |= HTTP_ACCEPT_ENCODING_GZIP; if (NULL != strstr(value, "deflate")) accept_encoding |= HTTP_ACCEPT_ENCODING_DEFLATE; if (NULL != strstr(value, "compress")) accept_encoding |= HTTP_ACCEPT_ENCODING_COMPRESS; - #ifdef USE_BZ2LIB -- if (p->conf.bzip2) { -- if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2; -- } -+ if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2; - #endif - if (NULL != strstr(value, "identity")) accept_encoding |= HTTP_ACCEPT_ENCODING_IDENTITY; - +- if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2; +- if (NULL != strstr(value, "identity")) accept_encoding |= HTTP_ACCEPT_ENCODING_IDENTITY; +- - /* get server side supported ones */ --#ifdef USE_BZ2LIB -- if (p->conf.bzip2) { -- srv_encodings |= HTTP_ACCEPT_ENCODING_BZIP2; -- } + #ifdef USE_BZ2LIB +- srv_encodings |= HTTP_ACCEPT_ENCODING_BZIP2; -#endif -#ifdef USE_ZLIB - srv_encodings |= HTTP_ACCEPT_ENCODING_GZIP; - srv_encodings |= HTTP_ACCEPT_ENCODING_DEFLATE; --#endif -- ++ if (NULL != strstr(value, "bzip2")) accept_encoding |= HTTP_ACCEPT_ENCODING_BZIP2; + #endif ++ if (NULL != strstr(value, "identity")) accept_encoding |= HTTP_ACCEPT_ENCODING_IDENTITY; + /* find matching entries */ - matched_encodings = accept_encoding & srv_encodings; + matched_encodings = accept_encoding & p->conf.allowed_encodings; ================================================================ ---- CVS-web: http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/lighttpd-mod_compress-disable-bzip2.patch?r1=1.4&r2=1.5&f=u _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit