/[Apache-SVN]/httpd/httpd/trunk/modules/filters/mod_deflate.c
ViewVC logotype

Log of /httpd/httpd/trunk/modules/filters/mod_deflate.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:

Revision 1914800 - (view) (download) (annotate) - [select for diffs]
Modified Wed Dec 20 13:07:40 2023 UTC (15 months, 4 weeks ago) by jorton
File length: 72360 byte(s)
Diff to previous 1895552 (colored)
mod_deflate: remove filter after seeing EOS

Submitted by: Eric Norris <enorris etsy.com>
Github: closes #387


Revision 1895552 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 3 13:07:42 2021 UTC (3 years, 4 months ago) by jorton
File length: 72250 byte(s)
Diff to previous 1894152 (colored)
* modules/filters/mod_deflate.c (deflate_in_filter): Handle FLUSH in
  the input brigade even if done inflating (ctx->done is true), but
  don't try to flush the inflate stream in that case.  (Caught by
  Coverity)

Github: closes #280


Revision 1894152 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 12 08:27:15 2021 UTC (3 years, 6 months ago) by jorton
File length: 72040 byte(s)
Diff to previous 1892728 (colored)
* modules/filters/mod_deflate.c (deflate_out_filter): Catch
  apr_bucket_read() errors.


Revision 1892728 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 30 10:05:06 2021 UTC (3 years, 7 months ago) by icing
File length: 71838 byte(s)
Diff to previous 1888083 (colored)
 * mod_deflate: refrain from reading buckets of known length, just
   to get their length. This may transform buckets unwanted (e.g. file
   to mmap) and prevent optimization down the filter chain.



Revision 1888083 - (view) (download) (annotate) - [select for diffs]
Modified Fri Mar 26 11:27:34 2021 UTC (4 years ago) by icing
File length: 71678 byte(s)
Diff to previous 1887364 (colored)
  *) core: provide ap_ssl_* functions in new http_ssl.h header file.



Revision 1887364 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 9 12:55:55 2021 UTC (4 years, 1 month ago) by icing
File length: 71656 byte(s)
Diff to previous 1874558 (colored)
Using the new ap_ssl_conn_is_ssl() and ap_ssl_var_lookup() in all internal modules.

 * leaving mod_nw_ssl and mod_ssl itself untouched
 * removing mod_ssl.h includes where no longer necessary
 * some modules might skip post_config hooks, but those were left in, even when empty now.



Revision 1874558 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 27 06:59:10 2020 UTC (5 years, 1 month ago) by gbechis
File length: 71851 byte(s)
Diff to previous 1874346 (colored)
"?:" is a GNU extension, use standard syntax
spotted by Christophe Jaillet


Revision 1874346 - (view) (download) (annotate) - [select for diffs]
Modified Sat Feb 22 00:14:49 2020 UTC (5 years, 1 month ago) by gbechis
File length: 71844 byte(s)
Diff to previous 1868313 (colored)
Avoid printing NULL strings in logs


Revision 1868313 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 11 20:21:14 2019 UTC (5 years, 6 months ago) by jailletc36
File length: 71834 byte(s)
Diff to previous 1849630 (colored)
Honor "Accept-Encoding: foo;q=0" as per RFC 7231; which means 'foo' is "not acceptable".  PR 58158

Revision 1849630 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 23 14:26:06 2018 UTC (6 years, 3 months ago) by stsp
File length: 71346 byte(s)
Diff to previous 1849590 (colored)
Use apr_uint64_t instead of uint64_t; Pointed out by ylavic


Revision 1849590 - (view) (download) (annotate) - [select for diffs]
Modified Sun Dec 23 09:26:56 2018 UTC (6 years, 3 months ago) by stsp
File length: 71318 byte(s)
Diff to previous 1843242 (colored)
Avoid hard-coded "%ld" format strings in mod_deflate's logging statements.
On some platforms (e.g. OpenBSD) zlib's input/output counters are off_t
instead of ulong, which resuls in format-string warnings from some
compilers (e.g. clang). Work around this by upcasting to uint64_t.
Discussed on dev@ with ylavic and wrowe


Revision 1843242 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 9 12:16:08 2018 UTC (6 years, 6 months ago) by kotkov
File length: 70949 byte(s)
Diff to previous 1842888 (colored)
mod_brotli, mod_deflate: Restore the separate handling of 304 Not Modified
responses allowing these modules to properly set or fix-up the response
headers such as Vary or ETag.

This change follows up on r1837056 that disabled that special handling and
thus resulted in a potential violation of RFC7232, 4.1:

   The server generating a 304 response MUST generate any of the following
   header fields that would have been sent in a 200 (OK) response to the
   same request: Cache-Control, Content-Location, Date, ETag, Expires,
   and Vary.)

References:
  https://lists.apache.org/thread.html/f5733ca6743757e8aa8b58a0cd9e27680971551c2a20f5606c66507e@%3Cdev.httpd.apache.org%3E
  https://tools.ietf.org/html/rfc7232#section-4.1

Revision 1842888 - (view) (download) (annotate) - [select for diffs]
Modified Fri Oct 5 10:43:46 2018 UTC (6 years, 6 months ago) by jorton
File length: 70707 byte(s)
Diff to previous 1837056 (colored)
* modules/filters/mod_deflate.c
  (deflate_out_filter): Fix typo setting output note. (Coverity warning)
  (deflate_in_filter): Fix redundant assignment. (clang warning)


Revision 1837056 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 30 13:08:23 2018 UTC (6 years, 8 months ago) by ylavic
File length: 70731 byte(s)
Diff to previous 1747469 (colored)
http: Enforce consistently no response body with both 204 and 304 statuses.

Provide AP_STATUS_IS_HEADER_ONLY() helper/macro to check for 204 or 304 and
use it where some special treatment is needed when no body is expected.

Some of those places handled 204 only.


Revision 1747469 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 9 00:06:42 2016 UTC (8 years, 10 months ago) by wrowe
File length: 70685 byte(s)
Diff to previous 1715876 (colored)
Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen

Revision 1715876 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 23 16:46:01 2015 UTC (9 years, 4 months ago) by ylavic
File length: 70667 byte(s)
Diff to previous 1715869 (colored)
Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).


Revision 1715869 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 23 16:28:36 2015 UTC (9 years, 4 months ago) by ylavic
File length: 70640 byte(s)
Diff to previous 1715789 (colored)
Revert r1715789: will re-commit without spurious functional changes.


Revision 1715789 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 23 12:33:09 2015 UTC (9 years, 4 months ago) by ylavic
File length: 70667 byte(s)
Diff to previous 1683047 (colored)
Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).

[Reverted by r1715869]


Revision 1683047 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 2 05:54:58 2015 UTC (9 years, 10 months ago) by jailletc36
File length: 70640 byte(s)
Diff to previous 1619486 (colored)
Constify + save a few bytes in conf pool

Revision 1619486 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 21 17:02:00 2014 UTC (10 years, 8 months ago) by ylavic
File length: 70718 byte(s)
Diff to previous 1619483 (colored)
mod_deflate:
- fix signed/unsigned (int/size_t) comparisons,
- add consume_buffer() to factorize code used multiple times,
- cleanup passed brigade (don't rely on next output filters to do it).


Revision 1619483 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 21 16:44:10 2014 UTC (10 years, 8 months ago) by ylavic
File length: 72836 byte(s)
Diff to previous 1619453 (colored)
mod_deflate: follow up to r1619444.

Fix counting of inflated bytes in deflate_in_filter() when asked to flush, since
we now count bytes per inflate() call everywhere, we can't count all the produced
bytes there.

We still need to include all the produced bytes in the brigade.


Revision 1619453 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 21 15:48:36 2014 UTC (10 years, 8 months ago) by ylavic
File length: 72747 byte(s)
Diff to previous 1619448 (colored)
mod_deflate: follow up to r1619444.

Add missing APLOGNO.


Revision 1619448 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 21 15:39:21 2014 UTC (10 years, 8 months ago) by covener
File length: 72742 byte(s)
Diff to previous 1619444 (colored)
leave a hint while scrolling through inflate() calls



Revision 1619444 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 21 15:30:14 2014 UTC (10 years, 8 months ago) by ylavic
File length: 72683 byte(s)
Diff to previous 1619383 (colored)
mod_deflate: follow up to r1619383.

deflate_in_filter():
- use inflated bytes per inflate() call to compute the total output bytes,
- check zlib errors before limits,
- add missing check_ratio() when asked to flush.

deflate_out_filter():
- check ratio after each inflate() call.


Revision 1619383 - (view) (download) (annotate) - [select for diffs]
Modified Thu Aug 21 13:11:15 2014 UTC (10 years, 8 months ago) by covener
File length: 72201 byte(s)
Diff to previous 1611725 (colored)
A misplaced check for inflation limits prevented limiting relatively
small inputs.  PR56872

Submitted By: Edward Lu 
Committed By: covener



Revision 1611725 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 18 17:21:16 2014 UTC (10 years, 9 months ago) by ylavic
File length: 72208 byte(s)
Diff to previous 1610518 (colored)
mod_deflate: don't require <limits.h> by using APR_INT32_MAX instead of INT_MAX.

Revision 1610518 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 14 20:44:21 2014 UTC (10 years, 9 months ago) by jailletc36
File length: 72215 byte(s)
Diff to previous 1610501 (colored)
Add missing APLOGNO + fix a typo in a comment

Revision 1610501 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 14 19:56:15 2014 UTC (10 years, 9 months ago) by covener
File length: 72192 byte(s)
Diff to previous 1604353 (colored)
  *) SECURITY: CVE-2014-0118 (cve.mitre.org)
     mod_deflate: The DEFLATE input filter (inflates request bodies) now
     limits the length and compression ratio of inflated request bodies to avoid
     denial of sevice via highly compressed bodies.  See directives 
     DeflateInflateLimitRequestBody, DeflateInflateRatioLimit,
     and DeflateInflateRatioBurst.

Thanks to Giancarlo Pellegrino and Davide Balzarotti for reporting the issue.

Submitted By: ylavic, covener
Reviewed By: jorton, covener, jim




Revision 1604353 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jun 21 13:15:06 2014 UTC (10 years, 10 months ago) by covener
File length: 66724 byte(s)
Diff to previous 1601624 (colored)
fix c++/c99 comment



Revision 1601624 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 10 12:44:15 2014 UTC (10 years, 10 months ago) by ylavic
File length: 66721 byte(s)
Diff to previous 1591307 (colored)
Strip useless apr_brigade_cleanup() calls.

Revision 1591307 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 30 14:21:05 2014 UTC (10 years, 11 months ago) by ylavic
File length: 66779 byte(s)
Diff to previous 1591302 (colored)
Rollback r1591302, wrong file commited.


Revision 1591302 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 30 14:14:53 2014 UTC (10 years, 11 months ago) by ylavic
File length: 68668 byte(s)
Diff to previous 1590509 (colored)
mod_cache: Don't add cached/revalidated entity headers to a 304 response.
           PR 55547.

When the conditional request meets the conditions of the stale then revalidated
entry, the forwarded 304 response includes the entity headers merged from the
cached headers (before updating the entry).
Strip them before returning a 304.

Since the entity headers are stripped elsewhere, factorize the code using a
new table (MOD_CACHE_ENTITY_HEADERS[]) containing these headers's names.


Revision 1590509 - (view) (download) (annotate) - [select for diffs]
Modified Sun Apr 27 22:39:32 2014 UTC (10 years, 11 months ago) by ylavic
File length: 66779 byte(s)
Diff to previous 1587639 (colored)
mod_deflate: follow up to r1587639.
Don't break the looped brigade when moving the FLUSH bucket to the returned bb
and continue reading.


Revision 1587639 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 15 17:21:45 2014 UTC (11 years ago) by ylavic
File length: 66714 byte(s)
Diff to previous 1587594 (colored)
mod_deflate: Don't return gzip-ed data when reading FLUSH bucket in INFLATE
             input filter, forward the FLUSH but keep reading should EOS/more
             follow (should not happen, but mod_deflate won't fix it).


Revision 1587594 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 15 14:29:30 2014 UTC (11 years ago) by ylavic
File length: 66593 byte(s)
Diff to previous 1586745 (colored)
mod_deflate: Delay INFLATE input filter's self removal until all the buffered
             buckets are out (including EOS). PR 46146.


Revision 1586745 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 11 18:59:30 2014 UTC (11 years ago) by ylavic
File length: 66524 byte(s)
Diff to previous 1586543 (colored)
mod_deflate: update empty log tags.

Revision 1586543 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 11 02:44:23 2014 UTC (11 years ago) by covener
File length: 66514 byte(s)
Diff to previous 1586542 (colored)
be explicit, for now the 0 val is the default, but it's
a likely candidate for someone to flip later.
 


Revision 1586542 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 11 02:42:05 2014 UTC (11 years ago) by covener
File length: 66469 byte(s)
Diff to previous 1573224 (colored)
Attempt to make progress on PR39727/PR45023 blocking migration
to 2.4.  Provide DeflateAlterETag directive to choose between 
2.2 behavior, 2.4 behavior, or dropping ETag from the compressed
representation.

Preserves 2.4 default which breas 304 responses for compressed content.



Revision 1573224 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 1 20:34:55 2014 UTC (11 years, 1 month ago) by ylavic
File length: 65140 byte(s)
Diff to previous 1572911 (colored)
mod_deflate: when consuming zlibs flags, APR_INCOMPLETE implies no more bytes available.

Revision 1572911 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 28 10:42:47 2014 UTC (11 years, 1 month ago) by ylavic
File length: 65188 byte(s)
Diff to previous 1572896 (colored)
mod_deflate: follows up r1572896.
Be safe from successive or post end-of-stream flush buckets.


Revision 1572896 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 28 09:42:41 2014 UTC (11 years, 1 month ago) by ylavic
File length: 65108 byte(s)
Diff to previous 1572671 (colored)
mod_deflate:
Don't fail when asked to flush inflated data to the user-agent and that
coincides with the end of stream ("Zlib error flushing inflate buffer").
PR 56196.

Submitted By: [Christoph Fausak <christoph.fausak glueckkanja com>]
Committed By: ylavic


Revision 1572671 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 27 18:15:03 2014 UTC (11 years, 1 month ago) by ylavic
File length: 64914 byte(s)
Diff to previous 1572670 (colored)
Commit 6 on 6 to fix reentrance (incomplete Zlib header or validation bytes) in mod_deflate's output and input filters.
PR 46146 (patches from duplicated PR 55666)

Ignore empty buckets and split buckets longer than INT_MAX (since zlib uses 32-bit ints only) in all filters.


Revision 1572670 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 27 18:08:34 2014 UTC (11 years, 1 month ago) by ylavic
File length: 64184 byte(s)
Diff to previous 1572669 (colored)
Commit 5 on 6 to fix reentrance (incomplete Zlib header or validation bytes) in mod_deflate's output and input filters.
PR 46146 (patches from duplicated PR 55666)

Handle Zlib flags in the inflate input filter as in the output filter, using consume_zlib_flags().


Revision 1572669 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 27 18:01:38 2014 UTC (11 years, 1 month ago) by ylavic
File length: 63877 byte(s)
Diff to previous 1572668 (colored)
Commit 4 on 6 to fix reentrance (incomplete Zlib header or validation bytes) in mod_deflate's output and input filters.
PR 46146 (patches from duplicated PR 55666)

Handle non blocking reads which would block in the inflate input filter (not an error).


Revision 1572668 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 27 17:57:13 2014 UTC (11 years, 1 month ago) by ylavic
File length: 63595 byte(s)
Diff to previous 1572663 (colored)
Commit 3 on 6 to fix reentrance (incomplete Zlib header or validation bytes) in mod_deflate's output and input filters.
PR 46146 (patches from duplicated PR 55666)

Handle Zlib validation bytes buffering (CRC + length) in the inflate input filter :
- use validation_buffer and validation_length as state,
- loop until all the bytes are received.


Revision 1572663 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 27 17:35:58 2014 UTC (11 years, 1 month ago) by ylavic
File length: 62928 byte(s)
Diff to previous 1572655 (colored)
Commit 2 on 6 to fix reentrance (incomplete Zlib header or validation bytes) in mod_deflate's output and input filters.
PR 46146 (patches from duplicated PR 55666)

Handle Zlib header buffering in the inflate input filter :
- loop until all the header is received,
- handle non blocking reads returning empty brigade,
- fix a double ap_get_brigade() when an EOS brigade is encountered while reading the header,
- in that case and no data was received so far, don't return an error but SUCCESS with the EOS, otherwise fail,
- don't remove the Content-Length and Content-MD5 headers until some data is read.

Still does not handle Zlib flags for now, next commits.


Revision 1572655 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 27 16:56:07 2014 UTC (11 years, 1 month ago) by ylavic
File length: 61578 byte(s)
Diff to previous 1572092 (colored)
Commit 1 on 6 to fix reentrance (incomplete Zlib header or validation bytes) in mod_deflate's output and input filters.
PR 46146 (patches from duplicated PR 55666)

Handle Zlib header buffering in the inflate output filter :
- add the new deflate_ctx_t fields needed to re-enter the Zlib header parsing,
- introduce the new consume_zlib_flags() function to parse/consume the ZLib flags (will be used by the other filters too),
- use it to handle incomplete header in the output filter (deflate).

This alone fixes PR 55666, but the issue remains for PR 46146 (inflate/deflate input filters), hence the following patches.


Revision 1572092 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 26 15:30:25 2014 UTC (11 years, 1 month ago) by jkaluza
File length: 59273 byte(s)
Diff to previous 1502772 (colored)
mod_deflate: fix decompression of files larger than 4GB. According to RFC1952,
Input SIZE (compLen) contains the size of the original input data modulo 2^32.

PR: 56062
Submitted by: Lukas Bezdicka


Revision 1502772 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 13 11:04:58 2013 UTC (11 years, 9 months ago) by rjung
File length: 59101 byte(s)
Diff to previous 1499679 (colored)
Improve error detection when decompressing
request bodies with trailing garbage:
- handle case where trailing bytes are in
  the same bucket.


Revision 1499679 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jul 4 08:44:26 2013 UTC (11 years, 9 months ago) by sf
File length: 58705 byte(s)
Diff to previous 1495825 (colored)
style fix (no code change)


Revision 1495825 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jun 23 14:56:27 2013 UTC (11 years, 9 months ago) by covener
File length: 58695 byte(s)
Diff to previous 1484914 (colored)
protect 'AP_DECLARE_MODULE(deflate)' from expansion to 
'AP_DECLARE_MODULE(z_deflate)' if zlib has been built with
-DZ_PREFIX.



Revision 1484914 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 21 19:28:29 2013 UTC (11 years, 11 months ago) by minfrin
File length: 58603 byte(s)
Diff to previous 1484832 (colored)
mod_deflate: Make sure we process any EOS bucket in our brigade and
save going the long way round.


Revision 1484832 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 21 15:10:46 2013 UTC (11 years, 11 months ago) by minfrin
File length: 58626 byte(s)
Diff to previous 1359057 (colored)
mod_deflate: Remove assumptions as to when an EOS bucket might arrive.
Gracefully step aside if the body size is zero.


Revision 1359057 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 9 10:58:22 2012 UTC (12 years, 9 months ago) by sf
File length: 57860 byte(s)
Diff to previous 1209766 (colored)
Make mod_deflate skip compression if compression is enabled at SSL level.



Revision 1209766 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 2 23:02:04 2011 UTC (13 years, 4 months ago) by sf
File length: 56782 byte(s)
Diff to previous 1187991 (colored)
Add lots of unique tags to error log messages


Revision 1187991 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 23 22:17:52 2011 UTC (13 years, 5 months ago) by sf
File length: 56377 byte(s)
Diff to previous 1174751 (colored)
Log reason for not deflating at level trace1


Revision 1174751 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 23 13:39:32 2011 UTC (13 years, 6 months ago) by jim
File length: 55248 byte(s)
Diff to previous 1171655 (colored)
Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



Revision 1171655 - (view) (download) (annotate) - [select for diffs]
Modified Fri Sep 16 16:40:52 2011 UTC (13 years, 7 months ago) by sf
File length: 55251 byte(s)
Diff to previous 1170330 (colored)
Add comment that the check for empty brigade at the start of the function is
essential.


Revision 1170330 - (view) (download) (annotate) - [select for diffs]
Modified Tue Sep 13 20:17:18 2011 UTC (13 years, 7 months ago) by sf
File length: 55194 byte(s)
Diff to previous 1152943 (colored)
Fix 'Content-Encoding: gzip' missing if the first brigade passed to
deflate_out_buffer contained zero data bytes but no EOS bucket.

Don't compress if the added headers and checksums are larger than
the data to compress (and we know the size of the data in advance).


Revision 1152943 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 1 21:48:03 2011 UTC (13 years, 8 months ago) by sf
File length: 54400 byte(s)
Diff to previous 1146418 (colored)
Fix endless loop if first bucket is metadata

PR: 51590
Submitted by: Torsten Foertsch <torsten foertsch gmx net>


Revision 1146418 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 13 20:38:33 2011 UTC (13 years, 9 months ago) by sf
File length: 54344 byte(s)
Diff to previous 1103315 (colored)
Don't try to compress requests with a zero sized body.

PR: 51350


Revision 1103315 - (view) (download) (annotate) - [select for diffs]
Modified Sun May 15 11:05:36 2011 UTC (13 years, 11 months ago) by jerenkrantz
File length: 53659 byte(s)
Diff to previous 1103199 (colored)
Fix memory leak in mod_deflate.c when SetOutputFilter is enabled and DEFLATE
is the first filter in the chain - this is seen with mod_dav + mod_deflate
when the client can not do gzip and we constantly do the filter checks.

* modules/filters/mod_deflate.c
  (deflate_ctx): Add a flag as to whether we are successfully initialized.
  (deflate_out_filter): Always create filter ctx and set filter_init flag only
  after we are successfully initialized.


Revision 1103199 - (view) (download) (annotate) - [select for diffs]
Modified Sat May 14 19:52:14 2011 UTC (13 years, 11 months ago) by sf
File length: 53242 byte(s)
Diff to previous 1098162 (colored)
Log messages at the various points where mod_deflate returns APR_EGENERAL.
Try to use level warning if the client sent invalid data and level error if
something went wrong on our side.


Revision 1098162 - (view) (download) (annotate) - [select for diffs]
Modified Sat Apr 30 21:18:58 2011 UTC (13 years, 11 months ago) by trawick
File length: 51166 byte(s)
Diff to previous 983117 (colored)
fix some dead assignments found by the clang analyzer


Revision 983117 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 6 20:10:25 2010 UTC (14 years, 8 months ago) by pgollucci
File length: 51174 byte(s)
Diff to previous 958253 (colored)
zRC is never used before its overwritten below the while loop

Reported by:	clang static analyzer


Revision 958253 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jun 26 17:41:01 2010 UTC (14 years, 9 months ago) by sf
File length: 51195 byte(s)
Diff to previous 951895 (colored)
Stop compressing if we are doing a HEAD request and the content-length filter
can't determine the content-length anyway.

Submitted by: Ruediger Pluem


Revision 951895 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jun 6 16:59:50 2010 UTC (14 years, 10 months ago) by sf
File length: 50579 byte(s)
Diff to previous 950302 (colored)
Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


Revision 950302 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 1 23:19:21 2010 UTC (14 years, 10 months ago) by niq
File length: 50597 byte(s)
Diff to previous 910326 (colored)
Kill off edge case in mod_deflate where data may be sent before headers
are determined.
PR 49369 - Matthew Steele


Revision 910326 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 15 20:12:07 2010 UTC (15 years, 2 months ago) by sf
File length: 50631 byte(s)
Diff to previous 910069 (colored)
Correctly handle the case where apr_brigade_partition() returns APR_INCOMPLETE
and bkt points to the sentinel of ctx->proc_bb and not the sentinel of bb.

Submitted by: Joe Schaefer <joe_schaefer yahoo com>


Revision 910069 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 14 20:36:58 2010 UTC (15 years, 2 months ago) by sf
File length: 50576 byte(s)
Diff to previous 821471 (colored)
In case zlib initialization fails, make sure we do not modify the Content-*
headers before sending the uncompressed content down the filter chain.


Revision 821471 - (view) (download) (annotate) - [select for diffs]
Modified Sun Oct 4 07:37:28 2009 UTC (15 years, 6 months ago) by sf
File length: 50211 byte(s)
Diff to previous 743814 (colored)
core, mod_deflate, mod_sed: Reduce memory usage by reusing bucket
brigades in several places


Revision 743814 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 12 17:43:39 2009 UTC (16 years, 2 months ago) by fielding
File length: 50297 byte(s)
Diff to previous 743595 (colored)
Adjust content metadata on deflate/inflate response before bailing out
on a 304 response so that the metadata does not differ from 200 response.


Revision 743595 - (view) (download) (annotate) - [select for diffs]
Modified Thu Feb 12 01:59:27 2009 UTC (16 years, 2 months ago) by fielding
File length: 50355 byte(s)
Diff to previous 741865 (colored)
Reimplement deflate_check_etag() so that it isn't such a pig
and correctly works with weak etags.  Related to PR 39727.

Note that there remains an error in ap_meets_conditions because
that function does not currently check for a transformed etag.
I am working on that.


Revision 741865 - (view) (download) (annotate) - [select for diffs]
Modified Sat Feb 7 09:25:28 2009 UTC (16 years, 2 months ago) by rpluem
File length: 49774 byte(s)
Diff to previous 740149 (colored)
* Only drop the last char (the '"') and not the last one of the etag itself.


Revision 740149 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 2 23:20:37 2009 UTC (16 years, 2 months ago) by lars
File length: 49774 byte(s)
Diff to previous 726794 (colored)
mod_deflate: Fix creation of invalid Etag headers. We now make sure
that the Etag value is properly quoted when adding the gzip marker.
PR 39727.


Revision 726794 - (view) (download) (annotate) - [select for diffs]
Modified Mon Dec 15 20:36:47 2008 UTC (16 years, 4 months ago) by rpluem
File length: 49690 byte(s)
Diff to previous 726791 (colored)
* Fix r->content_encoding for inflate_in and inflate_out filters.


Revision 726791 - (view) (download) (annotate) - [select for diffs]
Modified Mon Dec 15 20:22:07 2008 UTC (16 years, 4 months ago) by rpluem
File length: 49270 byte(s)
Diff to previous 607219 (colored)
*  Fix r->content_encoding in deflate_out_filter if it was set before.


Revision 607219 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 28 12:03:20 2007 UTC (17 years, 3 months ago) by niq
File length: 49033 byte(s)
Diff to previous 581198 (colored)
PR 39727: Fixup ETag handling in mod deflate (updated following extensive
discussion on-list).
This is not a full-and-final fix, because we don't ourselves do anything
useful with these ETags.  But at least we're no longer screwing up clients.


Revision 581198 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 2 11:48:03 2007 UTC (17 years, 6 months ago) by niq
File length: 49277 byte(s)
Diff to previous 580598 (colored)
mod_deflate: Don't leave a strong ETag in place while transforming the entity.
PR 39727

Comment: Another user just subscribed to this bug.
We need a fix more than we need an inconclusive discussion!


Revision 580598 - (view) (download) (annotate) - [select for diffs]
Modified Sat Sep 29 15:43:08 2007 UTC (17 years, 6 months ago) by niq
File length: 48219 byte(s)
Diff to previous 563803 (colored)
mod_deflate: initialise inflate-out filter correctly when the
first brigade contains no data buckets.
PR 43512


Revision 563803 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 8 10:39:23 2007 UTC (17 years, 8 months ago) by niq
File length: 48213 byte(s)
Diff to previous 563317 (colored)
Correcting defects in r563317: fix to PR 42993


Revision 563317 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 6 22:45:39 2007 UTC (17 years, 8 months ago) by niq
File length: 47668 byte(s)
Diff to previous 563230 (colored)
Check all sources of Content-Encoding in inflate_out filter
PR 42993
Reasoning: http://marc.info/?l=apache-httpd-dev&m=118643107831358&w=2


Revision 563230 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 6 19:24:10 2007 UTC (17 years, 8 months ago) by rpluem
File length: 47368 byte(s)
Diff to previous 563229 (colored)
* Also unset Content-MD5 in the deflate_out_filter


Revision 563229 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 6 19:22:23 2007 UTC (17 years, 8 months ago) by rpluem
File length: 47312 byte(s)
Diff to previous 563154 (colored)
* We already unset Content-Length in the inflate_out_filter. So move the
  comment and unsetting of Content-MD5 in the right place.


Revision 563154 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 6 14:37:42 2007 UTC (17 years, 8 months ago) by niq
File length: 47365 byte(s)
Diff to previous 563133 (colored)
Don't try to compress/decompress where there's a Content-Range.
According to RFC2616, the range would have to apply *after*
applying content-encoding, so anything that's been set before
running the deflate filter is going to be broken.



Revision 563133 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 6 13:53:35 2007 UTC (17 years, 8 months ago) by niq
File length: 46802 byte(s)
Diff to previous 562507 (colored)
mod_deflate - discussion on dev@
Postpone unsetting of headers until after first get_brigade from upstream


Revision 562507 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 3 15:42:30 2007 UTC (17 years, 8 months ago) by niq
File length: 46801 byte(s)
Diff to previous 560941 (colored)
Generalise the content encoding detection and protocol:
so it aslo works in inflate out filter, as suggested by rpluem.

NOTE: this fails with some generators (cgi, asis) due to a deeper bug:
content-encoding is set later than mod_deflate sees it.  This has always
been the case, and could use a separate fix if anyone wants inflate_out
other than in a proxy situation.  And it's not mod_deflate's problem.


Revision 560941 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 30 12:30:36 2007 UTC (17 years, 8 months ago) by niq
File length: 47158 byte(s)
Diff to previous 560937 (colored)
Be liberal in what we accept.  Where it matters.


Revision 560937 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 30 12:24:49 2007 UTC (17 years, 8 months ago) by niq
File length: 47107 byte(s)
Diff to previous 560811 (colored)
Be liberal and correct in what we accept


Revision 560811 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jul 29 20:47:44 2007 UTC (17 years, 8 months ago) by niq
File length: 46903 byte(s)
Diff to previous 560689 (colored)
Update r560689 following rpluem's analysis thereof.


Revision 560689 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jul 29 08:35:56 2007 UTC (17 years, 8 months ago) by niq
File length: 47132 byte(s)
Diff to previous 556113 (colored)
Fix protocol handling in mod_deflate input filter
PR 23287


Revision 556113 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 13 19:23:24 2007 UTC (17 years, 9 months ago) by gregames
File length: 45461 byte(s)
Diff to previous 556028 (colored)
don't need the definitions for error buckets any more


Revision 556028 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 13 15:11:16 2007 UTC (17 years, 9 months ago) by gregames
File length: 45488 byte(s)
Diff to previous 554011 (colored)
* generalize from error buckets to metadata buckets
* also applicable to the deflate input filter
* pass along metadata buckets rather than giving up mid-stream

vastly improved by: Rüdiger Plüm


Revision 554011 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 6 19:36:30 2007 UTC (17 years, 9 months ago) by gregames
File length: 45057 byte(s)
Diff to previous 476600 (colored)
with LimitRequestBody xxx and the deflate output filter configured, mod_deflate
eats the 413 error bucket, a 500 error is logged, and a blank screen appears
at the browser.


Revision 476600 - (view) (download) (annotate) - [select for diffs]
Modified Sat Nov 18 20:26:28 2006 UTC (18 years, 5 months ago) by niq
File length: 44893 byte(s)
Diff to previous 475922 (colored)
Housekeeping: keep track of size even in the edge-case where validation
bytes trickle in over multiple buckets.


Revision 475922 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 16 20:45:39 2006 UTC (18 years, 5 months ago) by rpluem
File length: 44833 byte(s)
Diff to previous 475920 (colored)
* Fix some comments. No functional change.


Revision 475920 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 16 20:41:06 2006 UTC (18 years, 5 months ago) by rpluem
File length: 44843 byte(s)
Diff to previous 475915 (colored)
* Also log the presence of garbage data at the end of the stream if all
  validation data is available in the first round.


Revision 475915 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 16 20:30:25 2006 UTC (18 years, 5 months ago) by rpluem
File length: 44570 byte(s)
Diff to previous 475406 (colored)
* Actually append new data to the validation buffer and do not overwrite old
  data already there by setting the correct offset for the target buffer.


Revision 475406 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 15 20:26:10 2006 UTC (18 years, 5 months ago) by rpluem
File length: 44355 byte(s)
Diff to previous 475403 (colored)
* Ensure that we do not perform our final operations twice if a second EOS
  falls down the chain by accident. Otherwise we are likely to run in a
  SEGFAULT. So remove ourselves from the chain.


Revision 475403 - (view) (download) (annotate) - [select for diffs]
Modified Wed Nov 15 20:19:37 2006 UTC (18 years, 5 months ago) by rpluem
File length: 44108 byte(s)
Diff to previous 426799 (colored)
* Ensure that we do not try to inflate validation data or garbage data. None
  of this is zlib's business.


Revision 426799 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 29 13:24:37 2006 UTC (18 years, 8 months ago) by rpluem
File length: 43693 byte(s)
Diff to previous 426795 (colored)
* Rework inflate out filter and give it a similar workflow as the deflate out
  filter. This fixes the following bugs in the inflate out filter:

  - Incorrect handling of flush buckets.
  - Excessive memory usage for large compressed content (because we now
    already sent parts down the chain and do not process the whole brigade
    first before sending something down the chain).
  - Handle the case correctly where the validation bytes at the end of
    the compressed data stream are distributed across different buckets /
    brigades.
  - Fix a memory leak due to not cleaning up the internal structures of
    libz in some error cases.

PR: 39854


Revision 426795 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 29 13:08:38 2006 UTC (18 years, 8 months ago) by rpluem
File length: 40370 byte(s)
Diff to previous 426793 (colored)
* some optimizations taken from the inflate out filter


Revision 426793 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 29 13:03:43 2006 UTC (18 years, 8 months ago) by rpluem
File length: 40347 byte(s)
Diff to previous 426791 (colored)
* We can ignore Z_BUF_ERROR in flush_libz_buffer because:
  When we call libz_func we can assume that

   - avail_in is zero (due to the surrounding code that calls
     flush_libz_buffer)
   - avail_out is non zero due to the fact that we just emptied
     the output buffer and stored it into a brigade

  So the only reason for Z_BUF_ERROR is that the internal libz
  buffers are now empty and thus we called libz_func one time
  too often. This does not hurt. It simply says that we are done.


Revision 426791 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 29 12:55:26 2006 UTC (18 years, 8 months ago) by rpluem
File length: 39787 byte(s)
Diff to previous 426790 (colored)
* Use a define for the number of validation bytes (CRC and length) after the
  compressed data


Revision 426790 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 29 12:49:51 2006 UTC (18 years, 8 months ago) by rpluem
File length: 39618 byte(s)
Diff to previous 425109 (colored)
* Add parameter crc to flush_libz_buffer in order to call the libz's crc32
  function on the output buffer if needed. This is actually needed by the
  later rework of the inflate out filter.


Revision 425109 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 24 16:17:12 2006 UTC (18 years, 9 months ago) by rpluem
File length: 38935 byte(s)
Diff to previous 424950 (colored)
* Rather use a pool cleanup function than calling deflateEnd before every
  return from function to ensure that libz's internals get cleaned up.


Revision 424950 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 24 07:43:40 2006 UTC (18 years, 9 months ago) by rpluem
File length: 39942 byte(s)
Diff to previous 424759 (colored)
* Initialize zRC to avoid a compiler warning.


Revision 424759 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jul 23 15:50:08 2006 UTC (18 years, 9 months ago) by rpluem
File length: 39935 byte(s)
Diff to previous 423940 (colored)
* This shortcut is too short. It is not up to the filters to decide
  whether filters down the chain can do something useful with this empty
  brigade.


Revision 423940 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jul 20 14:11:48 2006 UTC (18 years, 9 months ago) by rpluem
File length: 39901 byte(s)
Diff to previous 422739 (colored)
* In preparation of the changes of the inflate out filter:
  - rename flush_zlib_buffer to flush_libz_buffer (this name seems
    better)
  - add a parameter to tell flush_libz_buffer whether it should
    deflate or inflate as this function should be also used for the
    inflate out filter.


Revision 422739 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 17 15:24:29 2006 UTC (18 years, 9 months ago) by rpluem
File length: 39811 byte(s)
Diff to previous 422736 (colored)
* Remove ourselves from the filter chain if we failed to init libz, as we
  pass data down the filter chain uncompressed afterwards.


Revision 422736 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 17 15:08:27 2006 UTC (18 years, 9 months ago) by rpluem
File length: 39596 byte(s)
Diff to previous 422731 (colored)
* Fix potential memory leaks in deflate_out_filter if bailing out due to an
  error (either in the lower filter chain or during a libz operation). We need
  to call deflateEnd as it is very likely that this filter is never called
  again to ensures that libz's internal structures get cleaned properly.


Revision 422731 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jul 17 14:32:50 2006 UTC (18 years, 9 months ago) by rpluem
File length: 37940 byte(s)
Diff to previous 420983 (colored)
* Fix wrong FLUSH bucket handling in deflate_out_filter: Actually the internal
  structures of libz never got flushed as ctx->stream.avail_in is always zero
  here. As the EOS and the FLUSH bucket case use the same code for flushing
  libz's internal buffers move this code to the new function flush_zlib_buffer.


Revision 420983 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 11 20:33:53 2006 UTC (18 years, 9 months ago) by fielding
File length: 38125 byte(s)
Diff to previous 416165 (colored)
update license header text

Revision 416165 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 21 23:16:47 2006 UTC (18 years, 10 months ago) by niq
File length: 37978 byte(s)
Diff to previous 395228 (colored)
PR#39854
Remove bogus code that chokes on flush buckets


Revision 395228 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 19 12:11:27 2006 UTC (19 years ago) by colm
File length: 38774 byte(s)
Diff to previous 395079 (colored)
Update the copyright year in all .c, .h and .xml files


Revision 395079 - (view) (download) (annotate) - [select for diffs]
Modified Tue Apr 18 22:51:55 2006 UTC (19 years ago) by colm
File length: 38774 byte(s)
Diff to previous 332306 (colored)
Correctly handle internal redirects, by testing only for r-main == NULL.
ap_is_initial_req() returns false for internal redirects.


Revision 332306 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 10 15:11:44 2005 UTC (19 years, 5 months ago) by jim
File length: 38780 byte(s)
Diff to previous 161738 (colored)
No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


Revision 161738 - (view) (download) (annotate) - [select for diffs]
Modified Mon Apr 18 06:08:56 2005 UTC (20 years ago) by pquerna
File length: 38808 byte(s)
Diff to previous 161691 (colored)
- mod_deflate currently only does C-E, and not T-E. Fix the comment at the top saying it does T-E.


Revision 161691 - (view) (download) (annotate) - [select for diffs]
Modified Sun Apr 17 20:25:57 2005 UTC (20 years ago) by pquerna
File length: 38809 byte(s)
Diff to previous 151408 (colored)
mod_deflate should be merging the Vary header, not Setting it, and ignoring what other modules put there.

Spotted By: Rici Lake


Revision 151408 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 4 20:28:49 2005 UTC (20 years, 2 months ago) by jerenkrantz
File length: 38807 byte(s)
Diff to previous 109500 (colored)
Update copyright year to 2005 and standardize on current copyright owner line.


Revision 109500 - (view) (download) (annotate) - [select for diffs]
Modified Thu Dec 2 13:45:32 2004 UTC (20 years, 4 months ago) by jorton
File length: 38771 byte(s)
Diff to previous 106103 (colored)
* modules/filters/mod_deflate.c (deflate_out_filter): Check explicitly
for a 304 or 204 response rather than a brigade which begins with EOS,
to correctly handle such responses when generated by a CGI script.
Don't alter the headers for this case either.


Revision 106103 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 21 18:50:36 2004 UTC (20 years, 5 months ago) by nd
File length: 39172 byte(s)
Diff to previous 105410 (colored)
general property cleanup


Revision 105410 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 12 11:40:00 2004 UTC (20 years, 6 months ago) by jorton
File length: 39172 byte(s)
Diff to previous 105403 (colored)
* modules/filters/mod_deflate.c: Remove use of zutil.h (not installed
by zlib 1.2.1) and OS_CODE.  (deflate_out_filter): Simplify to use an
immortal brigade for the gzip header.

PR: 28673


Revision 105403 - (view) (download) (annotate) - [select for diffs]
Modified Mon Oct 11 10:46:17 2004 UTC (20 years, 6 months ago) by pquerna
File length: 40420 byte(s)
Diff to previous 104352 (colored)
Use the ap_is_initial_req() function to test for a subrequest instead of using r->main.


Revision 104352 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jul 23 12:40:49 2004 UTC (20 years, 9 months ago) by niq
File length: 40378 byte(s)
Diff to previous 104318 (colored)
Tidy up handling of empty brigades (Joe Orton);
Ensure we still set headers on HEAD and 204/304;
and fix inflate_out_filter handling of HEAD/etc.


Revision 104318 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jul 18 01:18:58 2004 UTC (20 years, 9 months ago) by niq
File length: 40525 byte(s)
Diff to previous 104315 (colored)
Tidy up: get rid of dubious cast (nd) and initialise encoding.


Revision 104315 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 17 15:22:35 2004 UTC (20 years, 9 months ago) by niq
File length: 40465 byte(s)
Diff to previous 104314 (colored)
Fix previous patch to deal correctly with multiple empty brigades before
we know if there's any content, and not re-process the headers.


Revision 104314 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 17 14:14:11 2004 UTC (20 years, 9 months ago) by niq
File length: 40069 byte(s)
Diff to previous 104166 (colored)
Fix headers in deflate_out_filter for the case of an empty first brigade


Revision 104166 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jul 4 21:34:37 2004 UTC (20 years, 9 months ago) by nd
File length: 39651 byte(s)
Diff to previous 104155 (colored)
style


Revision 104155 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jul 3 17:41:09 2004 UTC (20 years, 9 months ago) by nd
File length: 39655 byte(s)
Diff to previous 104034 (colored)
that's not really an error condition, so make the message APLOG_DEBUG.


Revision 104034 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 25 03:44:29 2004 UTC (20 years, 9 months ago) by niq
File length: 39653 byte(s)
Diff to previous 103910 (colored)
Update inflate_out_filter to support gzip compression flags.


Revision 103910 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 11 19:44:23 2004 UTC (20 years, 10 months ago) by ake
File length: 37898 byte(s)
Diff to previous 103810 (colored)
Don't deflate responses with zero length e.g. proxied 304's


Revision 103810 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jun 1 13:06:10 2004 UTC (20 years, 10 months ago) by jorton
File length: 37410 byte(s)
Diff to previous 103803 (colored)
* modules/filters/mod_deflate.c (deflate_out_filter): Destroy buckets
immediately after are used so that memory consumption is not
proportional to the size of the response.

PR: 29318


Revision 103803 - (view) (download) (annotate) - [select for diffs]
Modified Sat May 29 03:34:17 2004 UTC (20 years, 10 months ago) by jerenkrantz
File length: 37382 byte(s)
Diff to previous 103476 (colored)
Fix bug in mod_deflate that unconditionally sent deflate'd output even when
Accept-Encoding is not present.

Reported by Roy Fielding for http://cvs.apache.org/viewcvs/ with Safari.


Revision 103476 - (view) (download) (annotate) - [select for diffs]
Modified Wed Apr 21 22:08:34 2004 UTC (21 years ago) by nd
File length: 37389 byte(s)
Diff to previous 103420 (colored)
content-encoding needs to be unset.

Submitted by: Nick Kew <nick webthing.com>


Revision 103420 - (view) (download) (annotate) - [select for diffs]
Modified Sat Apr 17 00:26:52 2004 UTC (21 years ago) by nd
File length: 37328 byte(s)
Diff to previous 103405 (colored)
remove unused variables


Revision 103405 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 16 05:12:22 2004 UTC (21 years ago) by ianh
File length: 37369 byte(s)
Diff to previous 102618 (colored)
mod_deflate:
- New option for DEFLATE output file (force-gzip), which skips checking the accept-encoding header.
- New output filter 'INFLATE' for uncompressing responses.

Submitted by:   Nick Kew <Nick at WebThing dot com>
Reviewed by:    Ian Holsman


Revision 102618 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 9 20:31:03 2004 UTC (21 years, 2 months ago) by nd
File length: 29659 byte(s)
Diff to previous 102562 (colored)
fix name of The Apache Software Foundation


Revision 102562 - (view) (download) (annotate) - [select for diffs]
Modified Sun Feb 8 12:00:07 2004 UTC (21 years, 2 months ago) by nd
File length: 29655 byte(s)
Diff to previous 102525 (colored)
fix copyright dates according to the first checkin


Revision 102525 - (view) (download) (annotate) - [select for diffs]
Modified Fri Feb 6 22:58:42 2004 UTC (21 years, 2 months ago) by nd
File length: 29655 byte(s)
Diff to previous 102207 (colored)
apply Apache License, Version 2.0


Revision 102207 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 6 21:50:58 2004 UTC (21 years, 3 months ago) by ianh
File length: 31676 byte(s)
Diff to previous 102135 (colored)
remove email address in the hopes ppl stop emailing me directly ;(


Revision 102135 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 1 13:26:26 2004 UTC (21 years, 3 months ago) by nd
File length: 31694 byte(s)
Diff to previous 101788 (colored)
update license to 2004.


Revision 101788 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 16 02:09:14 2003 UTC (21 years, 5 months ago) by jwoolley
File length: 31694 byte(s)
Diff to previous 101019 (colored)
get rid of _FOREACH


Revision 101019 - (view) (download) (annotate) - [select for diffs]
Modified Tue Aug 19 14:56:12 2003 UTC (21 years, 8 months ago) by nd
File length: 31507 byte(s)
Diff to previous 101015 (colored)
here applies the same. Don't skip the \0 delimiter when searching
for already applied encodings. Additionally don't compress if *any*
non-identity encoding was applied before. (deflate, pkzip, whatever).


Revision 101015 - (view) (download) (annotate) - [select for diffs]
Modified Tue Aug 19 12:26:38 2003 UTC (21 years, 8 months ago) by nd
File length: 31275 byte(s)
Diff to previous 100966 (colored)
Doh. If Accept-Encoding contains no gzip token, we skip the 0 delimiter
and search for "gzip" somehwere in the memory. This was originally discovered
by Joe Orton. But there's more. We must skip any parameters, since these
do not contain what we're looking for.

PR: 21523


Revision 100966 - (view) (download) (annotate) - [select for diffs]
Modified Tue Aug 12 17:46:29 2003 UTC (21 years, 8 months ago) by stas
File length: 30993 byte(s)
Diff to previous 100730 (colored)
     Fix bug in mod_deflate, which was passing calling deflate()
     without checkinig first whether it has something to deflate. (currently
     this causes deflate to generate a fatal error according to the zlib spec).
     PR 22259.
PR:
Obtained from:
Submitted by:
Reviewed by:


Revision 100730 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jul 22 05:36:54 2003 UTC (21 years, 9 months ago) by jerenkrantz
File length: 30920 byte(s)
Diff to previous 99880 (colored)
Don't attempt to hold all of the response until we're done.  We'll pass data on
when the zlib buffer becomes full and we need to reset the buffer anyway.

Also, tidy up a similar semantic when we see the EOS by returning an error
if ap_pass_brigade gets an error (we'd lose it otherwise).


Revision 99880 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 16 22:49:04 2003 UTC (21 years, 11 months ago) by nd
File length: 30557 byte(s)
Diff to previous 98982 (colored)
Check also for r->content_encoding (now we should have them all...)
for already compressed content in mod_deflate.

PR: 19913
Submitted by: Tsuyoshi SASAMOTO <nazonazo@super.win.ne.jp>


Revision 98982 - (view) (download) (annotate) - [select for diffs]
Modified Tue Mar 11 18:11:33 2003 UTC (22 years, 1 month ago) by ianh
File length: 30313 byte(s)
Diff to previous 98948 (colored)
reflect backport of  mod_deflate.c r1.31
change directive from compressionlevel to deflatecompressionlevel

PR:
Obtained from:
Submitted by:	Ian Holsman, Andre Malo
Reviewed by:


Revision 98948 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 8 17:08:34 2003 UTC (22 years, 1 month ago) by nd
File length: 30306 byte(s)
Diff to previous 98895 (colored)
Check also err_headers_out for an already set Content-Encoding:
gzip header. This prevents gzip compressed content from a CGI
script from being compressed once more.

PR: 17797


Revision 98895 - (view) (download) (annotate) - [select for diffs]
Modified Wed Mar 5 22:14:33 2003 UTC (22 years, 1 month ago) by ianh
File length: 29937 byte(s)
Diff to previous 98689 (colored)
new directive 'compressionlevel'
Default compression level now changed to Zlib's default (was 'best_speed')

Obtained from: Stephen Pierzchala <stephen@pierzchala.com> Michael Schroepl <Michael.Schroepl@telekurs.de>
Reviewed by:  Ian Holsman


Revision 98689 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 17 04:46:00 2003 UTC (22 years, 2 months ago) by jerenkrantz
File length: 29207 byte(s)
Diff to previous 98573 (colored)
Fix potential memory leaks in mod_deflate on malformed input data.

PR: 16046


Revision 98573 - (view) (download) (annotate) - [select for diffs]
Modified Mon Feb 3 17:53:28 2003 UTC (22 years, 2 months ago) by nd
File length: 28813 byte(s)
Diff to previous 98154 (colored)
finished that boring job:
update license to 2003.

Happy New Year! ;-))


Revision 98154 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 2 21:47:39 2003 UTC (22 years, 3 months ago) by nd
File length: 28813 byte(s)
Diff to previous 98149 (colored)
break down macro code and avoid mixed case.

Thanks to Justin for his hints.


Revision 98149 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jan 1 20:31:37 2003 UTC (22 years, 3 months ago) by nd
File length: 28141 byte(s)
Diff to previous 97526 (colored)
The patch allows the user to log the accurate filter input and
output byte count, instead of only the rounded compression ratio.
The DeflateFilterNote directive will be extended as follows:

DeflateFilterNote [type] name

type can be one of "input", "output" or "ratio". "ratio" is assumed if the
type is omitted (backwards compatible).


Revision 97526 - (view) (download) (annotate) - [select for diffs]
Modified Thu Nov 14 19:22:26 2002 UTC (22 years, 5 months ago) by jwoolley
File length: 27534 byte(s)
Diff to previous 97473 (colored)
Fix a memory leak in mod_deflate with dynamic content.  Because the
brigade was being destroyed (ie, cleanup unregistered) rather than just
emptied out and then reused anyway, the last call down the filter stack
would leak buckets.

PR: 14321
Submitted by:	Ken Franken <kfranken@decisionmark.com>
Reviewed by:	Jeff Trawick, Cliff Woolley


Revision 97473 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 10 06:09:20 2002 UTC (22 years, 5 months ago) by jerenkrantz
File length: 27534 byte(s)
Diff to previous 96590 (colored)
Always emit Vary header if mod_deflate is involved in the request.

Submitted by:	Andr��Malo <nd@perlig.de>
Reviewed by:	Justin Erenkrantz


Revision 96590 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 30 16:31:17 2002 UTC (22 years, 7 months ago) by ianh
File length: 27306 byte(s)
Diff to previous 96588 (colored)
actuall fix the bug


Revision 96588 - (view) (download) (annotate) - [select for diffs]
Modified Fri Aug 30 16:08:03 2002 UTC (22 years, 7 months ago) by ianh
File length: 27290 byte(s)
Diff to previous 96318 (colored)
deflate's filter removal was reversed for non-html files, resulting
in it never being applied for non-html files
Submitted by:	Kris Verbeeck <Kris.Verbeeck@ubizen.com>


Revision 96318 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 7 15:26:17 2002 UTC (22 years, 8 months ago) by ianh
File length: 27291 byte(s)
Diff to previous 95906 (colored)
mod-deflate now checks to make sure gzip-only-text-html is set to 1, not anything.
This will allow things like...
SetEnv gzip-only-text/html 1
BrowserMatch "GECKO" gzip-only-text/html=0

Obtained from: Andr� Schild <A.Schild@aarboard.ch>
Reviewed by:   Ian Holsman


Revision 95906 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 28 08:40:25 2002 UTC (22 years, 9 months ago) by jerenkrantz
File length: 27139 byte(s)
Diff to previous 95676 (colored)
Add a filter_init function to the filters so that a filter can execute
arbitrary code before the handlers are invoked.

This resolves an issue with incorrect 304s on If-Modified-Since mod_include
requests since ap_meets_conditions() is not aware that this is a dynamic
request and it is not possible to satisfy 304 for these requests (unless
xbithack full is on, of course).  When mod_include runs as a filter, it is
too late to set any flag since the handler is responsible for calling
ap_meets_conditions(), which it should do before generating any data.

If a module doesn't need to run such arbitrary code, it can just pass NULL
as the argument and all is well.

PR:	9673
Reviewed by:	Ryan Bloom and others


Revision 95676 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 14 17:16:59 2002 UTC (22 years, 10 months ago) by wrowe
File length: 27127 byte(s)
Diff to previous 95666 (colored)
  Clean up a signedness emit


Revision 95666 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 14 07:58:34 2002 UTC (22 years, 10 months ago) by jerenkrantz
File length: 27105 byte(s)
Diff to previous 95615 (colored)
Modify the deflate input filter so that it should always return data on a
blocking read.


Revision 95615 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 12 07:40:54 2002 UTC (22 years, 10 months ago) by wrowe
File length: 26347 byte(s)
Diff to previous 95548 (colored)
  An important observations before some x86'er attacks this idea.


Revision 95548 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 6 15:25:21 2002 UTC (22 years, 10 months ago) by trawick
File length: 26314 byte(s)
Diff to previous 95521 (colored)
get the prototype for strcasecmp() on AIX


Revision 95521 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jun 5 09:08:02 2002 UTC (22 years, 10 months ago) by jerenkrantz
File length: 26267 byte(s)
Diff to previous 95413 (colored)
Oops.

When deflating: only reset ctx->stream buffers when the ctx was NULL.
When inflating: remember to clear the ctx->bb after we're done with it.


Revision 95413 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 30 22:06:01 2002 UTC (22 years, 10 months ago) by jwoolley
File length: 26269 byte(s)
Diff to previous 95399 (colored)
Why the stack buffer and the copy?  This seems much more straightforward.


Revision 95399 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 30 11:00:42 2002 UTC (22 years, 10 months ago) by trawick
File length: 26566 byte(s)
Diff to previous 95397 (colored)
keep the signed-ness of char buffers consistent with what is expected
by functions they are passed to (putLong() this time)


Revision 95397 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 30 08:32:09 2002 UTC (22 years, 10 months ago) by jerenkrantz
File length: 26557 byte(s)
Diff to previous 95359 (colored)
Unroll the putLong and getLong loops and correct putLong's input param type to
be unsigned char* instead of char*.

Submitted by:	Sander Striker
Reviewed by:	Justin Erenkrantz


Revision 95359 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 29 17:55:42 2002 UTC (22 years, 10 months ago) by jerenkrantz
File length: 26453 byte(s)
Diff to previous 95350 (colored)
Make sure that z_RC is not Z_STREAM_END in case we get a 0-length bucket
and we don't enter the while loop.

Submitted by:	Jeff Trawick's horde of picky compilers


Revision 95350 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 29 14:26:00 2002 UTC (22 years, 10 months ago) by trawick
File length: 26428 byte(s)
Diff to previous 95345 (colored)
get mod_deflate to compile with compilers that care about the
signed-ness of char *

it looks like it should work fine, but it is untested


Revision 95345 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 29 10:27:05 2002 UTC (22 years, 10 months ago) by jerenkrantz
File length: 26449 byte(s)
Diff to previous 95343 (colored)
Input filter support for mod_deflate.

Highly experimental, but known to work for some tests.


Revision 95343 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 29 07:23:10 2002 UTC (22 years, 10 months ago) by jerenkrantz
File length: 17931 byte(s)
Diff to previous 95341 (colored)
Add a note indicating what it would take to get MTIME field populated.
(I did this locally, but didn't figure it was worth committing, but it's
still worth noting.)


Revision 95341 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 29 06:40:23 2002 UTC (22 years, 10 months ago) by jerenkrantz
File length: 17403 byte(s)
Diff to previous 95339 (colored)
Implement flushing support for mod_deflate.
(Review of RFC 1952 indicates that this is indeed easily allowable.)


Revision 95339 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 29 05:48:57 2002 UTC (22 years, 10 months ago) by jerenkrantz
File length: 16993 byte(s)
Diff to previous 95181 (colored)
Allow mod_deflate to be more tolerant of multiple content-encodings.

- Tighten scope of a few affected variables (accepts, token).
- Look for gzip in r->headers_out (!) - if there, we've already compressed.
  (Previously, we'd look at r->headers_in which was bogus - we're output.)
- Switch the Accept-Encoding check to be case-insensitive per RFC 2616.
- Remove commented-out code.
- If C-E wasn't present or it was just "identity," set C-E to "gzip",
  otherwise, merge "gzip" onto the C-E list.

This patch was originally submitted by Ian and cleaned up and tested by
Justin.

Submitted by:	Ian Holsman
Reviewed by:	Justin Erenkrantz


Revision 95181 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 20 00:07:33 2002 UTC (22 years, 11 months ago) by ianh
File length: 16428 byte(s)
Diff to previous 95151 (colored)
content with "Content-Encoding" header, content is encoded.
But mod_deflate does not check it. It cause to encode content twice.

This problem is reproducable by getting encoded content via mod_proxy.

Patch Contributed by kaz@asada.sytes.net (ASADA Kazuhisa)
Bug #9222

Thanks Kazuhisa


Revision 95151 - (view) (download) (annotate) - [select for diffs]
Modified Fri May 17 11:33:10 2002 UTC (22 years, 11 months ago) by trawick
File length: 16194 byte(s)
Diff to previous 95055 (colored)
stop using APLOG_NOERRNO in calls to ap_log_[pr]error()


Revision 95055 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 13 07:11:01 2002 UTC (22 years, 11 months ago) by jerenkrantz
File length: 16226 byte(s)
Diff to previous 94987 (colored)
Fix mod_deflate corruption when using multiple input buckets.  We should
only clear *_out when we are the beginning or avail_out == 0.

Justin was tracking this down before he went to WWDC and didn't finish
before he left.  A (virtual) beer goes to Asada who filed this PR with
the right patch!

PR: 9014
Submitted by:	kaz@asada.sytes.net (ASADA Kazuhisa)
Reviewed by:	Justin Erenkrantz


Revision 94987 - (view) (download) (annotate) - [select for diffs]
Modified Tue May 7 00:35:16 2002 UTC (22 years, 11 months ago) by jerenkrantz
File length: 16186 byte(s)
Diff to previous 94982 (colored)
Add DeflateBufferSize directive to replace hardcoded FILTER_BUFSIZE
definition.  Also speeds up ctx init since it takes the buffer and does
a malloc rather than a calloc on it.


Revision 94982 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 6 23:37:15 2002 UTC (22 years, 11 months ago) by jerenkrantz
File length: 15525 byte(s)
Diff to previous 94979 (colored)
If we determine that we shouldn't be involved in this request, remove
ourselves from the filter chain (so we don't duplicate this path
each time a brigade comes through).


Revision 94979 - (view) (download) (annotate) - [select for diffs]
Added Mon May 6 22:23:52 2002 UTC (22 years, 11 months ago) by jerenkrantz
File length: 15325 byte(s)
Move mod_deflate from experimental to filters to represent our belief
in its stability.


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26