Browse Source

don't compress too small files (fixes #1241)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1918 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.17
Jan Kneschke 15 years ago
parent
commit
e8abdbf94e
  1. 1
      NEWS
  2. 7
      src/mod_compress.c

1
NEWS

@ -7,6 +7,7 @@ NEWS
* added dir-listing.set-footer in mod_dirlisting (#1277)
* fixed hardcoded font-sizes in mod_dirlisting (#1267)
* fixed different ETag length on 32/64 platforms (#1279)
* fixed compression of files < 128 bytes by disabling compression (#1241)
- 1.4.16 -

7
src/mod_compress.c

@ -589,6 +589,13 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
/* don't compress files that are too large as we need to much time to handle them */
if (max_fsize && (sce->st.st_size >> 10) > max_fsize) return HANDLER_GO_ON;
/* don't try to compress files less than 128 bytes
*
* - extra overhead for compression
* - mmap() fails for st_size = 0 :)
*/
if (sce->st.st_size < 128) return HANDLER_GO_ON;
/* check if mimetype is in compress-config */
for (m = 0; m < p->conf.compress->used; m++) {
data_string *compress_ds = (data_string *)p->conf.compress->data[m];

Loading…
Cancel
Save