280f2be18fd12370939b5626e3113de6cb667d60 1619486 |
|
21-Aug-2014 |
ylavic |
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). |
ef4d296591fb8a6a49452c9051762ebf0315bd89 1619483 |
|
21-Aug-2014 |
ylavic |
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. |
bd433ea5b094adc2c7d27673c6ee4161951e30bf 1619453 |
|
21-Aug-2014 |
ylavic |
mod_deflate: follow up to r1619444.
Add missing APLOGNO. |
0564553e058ed69d46219cd682d06b114f5219f7 1619448 |
|
21-Aug-2014 |
covener |
leave a hint while scrolling through inflate() calls |
ad7971e1cef8619c3b6aa459d0922f76e3bda59e 1619444 |
|
21-Aug-2014 |
ylavic |
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. |
b533beed40c06718fea1fc716ba09acd92621bed 1619383 |
|
21-Aug-2014 |
covener |
A misplaced check for inflation limits prevented limiting relatively
small inputs. PR56872
Submitted By: Edward Lu
Committed By: covener |
c304cf0d881b60c0c4a657ffe7ab301be76b931f 1611725 |
|
18-Jul-2014 |
ylavic |
mod_deflate: don't require <limits.h> by using APR_INT32_MAX instead of INT_MAX. |
9f077a11936791e3f4ae275235af82171794c4ca 1610518 |
|
14-Jul-2014 |
jailletc36 |
Add missing APLOGNO + fix a typo in a comment |
405b923af164f407e88dfcb830a6c439c1e19dad 1610501 |
|
14-Jul-2014 |
covener |
*) 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 |
64dd2829b1d2a7b62270554584ead7c786f80965 1604353 |
|
21-Jun-2014 |
covener |
fix c++/c99 comment |
7619b51fca6ecf16c28389e52a666e82f3c8d3ef 1601624 |
|
10-Jun-2014 |
ylavic |
Strip useless apr_brigade_cleanup() calls. |
47315381bddad596a0eda1b464952d52a114b616 1591307 |
|
30-Apr-2014 |
ylavic |
Rollback r1591302, wrong file commited. |
673ccef0a9c6fe9aad859c2b434507e46da6caf6 1591302 |
|
30-Apr-2014 |
ylavic |
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. |
c2cd141330f800bfe97ba96958459d3cba76b707 1590509 |
|
28-Apr-2014 |
ylavic |
mod_deflate: follow up to r1587639.
Don't break the looped brigade when moving the FLUSH bucket to the returned bb
and continue reading. |
46ccb8b5aac1a660017c42604895ffd11db7bbd8 1587639 |
|
15-Apr-2014 |
ylavic |
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). |
368ed5a8f77447bf53ee75e92370b127371a40f6 1587594 |
|
15-Apr-2014 |
ylavic |
mod_deflate: Delay INFLATE input filter's self removal until all the buffered
buckets are out (including EOS). PR 46146. |
8af7225539381e4f9725d03b7cbf49fc3ffd2ea3 1586745 |
|
11-Apr-2014 |
ylavic |
mod_deflate: update empty log tags. |
98d7e19284f53b7127a526d68da4ab6de2c0fbc4 1586543 |
|
11-Apr-2014 |
covener |
be explicit, for now the 0 val is the default, but it's
a likely candidate for someone to flip later. |
2e15620d724fb8e3a5be183b917359a2fd6e9468 1586542 |
|
11-Apr-2014 |
covener |
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. |
812278d915c669d881fd72b27bf19e032ed87d2d 1573224 |
|
01-Mar-2014 |
ylavic |
mod_deflate: when consuming zlibs flags, APR_INCOMPLETE implies no more bytes available. |
b9733369ba3ffdd7dd897e47f4334bf7bfe7be51 1572911 |
|
28-Feb-2014 |
ylavic |
mod_deflate: follows up r1572896.
Be safe from successive or post end-of-stream flush buckets. |
41610b3dbe4260ea443e495491cdb135caaaae1b 1572896 |
|
28-Feb-2014 |
ylavic |
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 |
f1794b6324ef405cf874134f8781f9bd219ac74a 1572671 |
|
27-Feb-2014 |
ylavic |
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. |
83122eb2e3686886288cf2f9b1d45ff91e15c041 1572670 |
|
27-Feb-2014 |
ylavic |
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(). |
74348bd66596022821fa1fe781f77fbb920f3c77 1572669 |
|
27-Feb-2014 |
ylavic |
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). |
df876b24f0ba9ec6126fdd47a715198003bbd03b 1572668 |
|
27-Feb-2014 |
ylavic |
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. |
ff7cc2f714d8d6ddec28a64c59488812f20bb874 1572663 |
|
27-Feb-2014 |
ylavic |
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. |
85d69391f25b6f9f3e5f77cc63c3ffc54d8d39d1 1572655 |
|
27-Feb-2014 |
ylavic |
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. |
8d7a312c08ff7f6b0ec9077849a3545ef906c30b 1572092 |
|
26-Feb-2014 |
jkaluza |
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 |
c692b522ccd97864a998634a00d9260b5b7333b9 1502772 |
|
13-Jul-2013 |
rjung |
Improve error detection when decompressing
request bodies with trailing garbage:
- handle case where trailing bytes are in
the same bucket. |
386717a04d1358302e8df2b29d3e5c4e3940a9cb 1499679 |
|
04-Jul-2013 |
sf |
style fix (no code change) |
63a5ea80bddcc84a462e40f402b4f330e0e05411 1495825 |
|
23-Jun-2013 |
covener |
protect 'AP_DECLARE_MODULE(deflate)' from expansion to
'AP_DECLARE_MODULE(z_deflate)' if zlib has been built with
-DZ_PREFIX. |
292f1c0c692c6533130b5383a965381b6033cf2d 1484914 |
|
21-May-2013 |
minfrin |
mod_deflate: Make sure we process any EOS bucket in our brigade and
save going the long way round. |
9e0d78337da0ce66247fc3254b9d5be262cbcea8 1484832 |
|
21-May-2013 |
minfrin |
mod_deflate: Remove assumptions as to when an EOS bucket might arrive.
Gracefully step aside if the body size is zero. |
aab4f2fecf2ad67c8cb414917d5254e3174642e9 1359057 |
|
09-Jul-2012 |
sf |
Make mod_deflate skip compression if compression is enabled at SSL level. |
185aa71728867671e105178b4c66fbc22b65ae26 1209766 |
|
03-Dec-2011 |
sf |
Add lots of unique tags to error log messages |
f22459230f348f6e1af4055cb3da596f88d8dd1a 1187991 |
|
24-Oct-2011 |
sf |
Log reason for not deflating at level trace1 |
5bfaaf573bacb45c1cf290ce85ecc676587e8a64 1174751 |
|
23-Sep-2011 |
jim |
Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change |
b9ec853fde48cd5a72878a8461658199d85e82d5 1171655 |
|
16-Sep-2011 |
sf |
Add comment that the check for empty brigade at the start of the function is
essential. |
145883eb83e8b93c0768b79b8aa2ea939febc661 1170330 |
|
13-Sep-2011 |
sf |
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). |
6defa5d20691765eb0b98daf5db4b1004353222e 1152943 |
|
01-Aug-2011 |
sf |
Fix endless loop if first bucket is metadata
PR: 51590
Submitted by: Torsten Foertsch <torsten foertsch gmx net> |
5d1aa7e499fc511e937db7a7ce671add9a4d6702 1146418 |
|
13-Jul-2011 |
sf |
Don't try to compress requests with a zero sized body.
PR: 51350 |
81b12625e2868b489345a6bed20e9d1b0f3d7b84 1103315 |
|
15-May-2011 |
jerenkrantz |
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. |
fdfca053ab4f6afc14bef98df044813c7c1b278d 1103199 |
|
14-May-2011 |
sf |
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. |
4fca72b7b53b5419325e06837c98266148111b52 1098162 |
|
30-Apr-2011 |
trawick |
fix some dead assignments found by the clang analyzer |
db4a621da9705ae4c39e73f19689a20d82b0be0f 983117 |
|
06-Aug-2010 |
pgollucci |
zRC is never used before its overwritten below the while loop
Reported by: clang static analyzer |
bb4cb70a104111f076482c0591417f3111874c06 958253 |
|
26-Jun-2010 |
sf |
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 |
36ef8f77bffe75d1aa327882be1b5bdbe2ff567a 951895 |
|
06-Jun-2010 |
sf |
Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels |
1a668f25bc6b4b111822caaba70bb9289d64ade5 950302 |
|
02-Jun-2010 |
niq |
Kill off edge case in mod_deflate where data may be sent before headers
are determined.
PR 49369 - Matthew Steele |
b9721f808604495d9714093732cfb67b1591d97d 910326 |
|
15-Feb-2010 |
sf |
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> |
c1fedca63bb98d622db3ae53f3dd78b431ef6587 910069 |
|
14-Feb-2010 |
sf |
In case zlib initialization fails, make sure we do not modify the Content-*
headers before sending the uncompressed content down the filter chain. |
58015652ffe00f004c6404a0631474f23dadc7da 821471 |
|
04-Oct-2009 |
sf |
core, mod_deflate, mod_sed: Reduce memory usage by reusing bucket
brigades in several places |
d2696ac6757b3d8bdaa27634a141ac8c8a045e08 743814 |
|
12-Feb-2009 |
fielding |
Adjust content metadata on deflate/inflate response before bailing out
on a 304 response so that the metadata does not differ from 200 response. |
2892513ed1fcff8f9597b8c25070dd5f142a614a 743595 |
|
12-Feb-2009 |
fielding |
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. |
b19564a7dc481cd465fbe94b8954a6dc3553dd88 741865 |
|
07-Feb-2009 |
rpluem |
* Only drop the last char (the '"') and not the last one of the etag itself. |
1782dcd420de504978945e6b812523eeae6d56a2 740149 |
|
03-Feb-2009 |
lars |
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. |
25450e348532814be817ca9b3e3107fc69ce6720 726794 |
|
15-Dec-2008 |
rpluem |
* Fix r->content_encoding for inflate_in and inflate_out filters. |
330a5c355b675fb25ed1c2a7a4721d0e617ed48b 726791 |
|
15-Dec-2008 |
rpluem |
* Fix r->content_encoding in deflate_out_filter if it was set before. |
d7caab9de97ace25ea2bb444317379e96464ef97 607219 |
|
28-Dec-2007 |
niq |
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. |
f09bf2676d29e43c211b663f5c9423815d83395f 581198 |
|
02-Oct-2007 |
niq |
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! |
0b2361dac549453500c8df060975ac788a02d2eb 580598 |
|
29-Sep-2007 |
niq |
mod_deflate: initialise inflate-out filter correctly when the
first brigade contains no data buckets.
PR 43512 |
3d792df6c427e18e68e87ad247db46bd4329c1bf 563803 |
|
08-Aug-2007 |
niq |
Correcting defects in r563317: fix to PR 42993 |
c05a38095129d25a4ad10aa51584c774458fb089 563317 |
|
07-Aug-2007 |
niq |
Check all sources of Content-Encoding in inflate_out filter
PR 42993
Reasoning: http://marc.info/?l=apache-httpd-dev&m=118643107831358&w=2 |
80ca7045014fd5f8cb7c30555cd09f458bb37902 563230 |
|
06-Aug-2007 |
rpluem |
* Also unset Content-MD5 in the deflate_out_filter |
19baac328f82ea4c2832d9e228ebfbd2fa4c6c33 563229 |
|
06-Aug-2007 |
rpluem |
* We already unset Content-Length in the inflate_out_filter. So move the
comment and unsetting of Content-MD5 in the right place. |
dd3546fc9a35c89d0d415ece6988ddfb960e52a4 563154 |
|
06-Aug-2007 |
niq |
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. |
f2f26bae68c4fef3ab9a9cee3d4d00c622609ff0 563133 |
|
06-Aug-2007 |
niq |
mod_deflate - discussion on dev@
Postpone unsetting of headers until after first get_brigade from upstream |
13a56b23b8e66df8f0b5a39ceda652fd5c96c95b 562507 |
|
03-Aug-2007 |
niq |
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. |
a0cfc53ee6f69dba01de25471b86f59b92637e75 560941 |
|
30-Jul-2007 |
niq |
Be liberal in what we accept. Where it matters. |
208720b4b0fe065f30efe2e5d5fb67ca48876c79 560937 |
|
30-Jul-2007 |
niq |
Be liberal and correct in what we accept |
3a9115f7abcbaafff22e47b2b2529d163cedffca 560811 |
|
29-Jul-2007 |
niq |
Update r560689 following rpluem's analysis thereof. |
13dcd384fbb417166276fdf0ab1706c27d04e385 560689 |
|
29-Jul-2007 |
niq |
Fix protocol handling in mod_deflate input filter
PR 23287 |
7b5b78d88a0ce290333bb727a120449ca4a0df14 556113 |
|
13-Jul-2007 |
gregames |
don't need the definitions for error buckets any more |
10eb5e89c22ffb974fc94daf02bc3dc9b9f208b8 556028 |
|
13-Jul-2007 |
gregames |
* 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 |
bf1fd31e18253ffd1a081e7d8dbaf4ff90055ac2 554011 |
|
06-Jul-2007 |
gregames |
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. |
3701e4c6487cb6a47a88afb9209e7a9ddc6f596b 476600 |
|
18-Nov-2006 |
niq |
Housekeeping: keep track of size even in the edge-case where validation
bytes trickle in over multiple buckets. |
79d5ebc46d93ee3a76c1fc0445286e55360a6b11 475922 |
|
16-Nov-2006 |
rpluem |
* Fix some comments. No functional change. |
11fe895294ba4c0e568f0f60ab7faf915f910764 475920 |
|
16-Nov-2006 |
rpluem |
* Also log the presence of garbage data at the end of the stream if all
validation data is available in the first round. |
204e5c744081430cc3e5ed8bdede74d06c35fa36 475915 |
|
16-Nov-2006 |
rpluem |
* 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. |
6c6538dee6d1847c911db33d52c9e64ed15d1d46 475406 |
|
15-Nov-2006 |
rpluem |
* 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. |
dbd45c392834378529ea2c5cfd60f580306d657b 475403 |
|
15-Nov-2006 |
rpluem |
* Ensure that we do not try to inflate validation data or garbage data. None
of this is zlib's business. |
e987e62f1e16ee33e20a029276b2a2c930d94081 426799 |
|
29-Jul-2006 |
rpluem |
* 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 |
fe155ecf12b5a8808971f7fd27b4f18276a575b6 426795 |
|
29-Jul-2006 |
rpluem |
* some optimizations taken from the inflate out filter |
db259e151f2af56bdc2f6ad584d41b98c5cc6d22 426793 |
|
29-Jul-2006 |
rpluem |
* 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. |
f50b82fc0bb1806adc6c64d1be8057dc3dbe5c79 426791 |
|
29-Jul-2006 |
rpluem |
* Use a define for the number of validation bytes (CRC and length) after the
compressed data |
76ea05cbf58bee398f5a026baff42a7ebe28d2ce 426790 |
|
29-Jul-2006 |
rpluem |
* 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. |
c3df765ded634aedd1836ac68a276e97d9182d79 425109 |
|
24-Jul-2006 |
rpluem |
* Rather use a pool cleanup function than calling deflateEnd before every
return from function to ensure that libz's internals get cleaned up. |
c5d3e1cb32338a6afb0e9cc40390bb960b876610 424950 |
|
24-Jul-2006 |
rpluem |
* Initialize zRC to avoid a compiler warning. |
b3971e2c9c556641a1e60081ddfaa2dbd63460c6 424759 |
|
23-Jul-2006 |
rpluem |
* 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. |
e0d55090f6e57306f9afc63794df3eb3a0805821 423940 |
|
20-Jul-2006 |
rpluem |
* 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. |
801bbccaa4a5d107d2708b2cd9173ddff0af5afa 422739 |
|
17-Jul-2006 |
rpluem |
* Remove ourselves from the filter chain if we failed to init libz, as we
pass data down the filter chain uncompressed afterwards. |
57402e7f164e53ac80e6fdfa140456257b8ce235 422736 |
|
17-Jul-2006 |
rpluem |
* 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. |
8f44ddc38d170527326731adcf6daad648cfd3ab 422731 |
|
17-Jul-2006 |
rpluem |
* 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. |
842ae4bd224140319ae7feec1872b93dfd491143 420983 |
|
11-Jul-2006 |
fielding |
update license header text |
886c49d794748b382b6e90531b978cb1df0d2165 416165 |
|
22-Jun-2006 |
niq |
PR#39854
Remove bogus code that chokes on flush buckets |
3d81f57512275ca06a60a9bcbd23c1f8b429fdf2 395228 |
|
19-Apr-2006 |
colm |
Update the copyright year in all .c, .h and .xml files |
cac9ad7277e615599b739a13336f917840007e8a 395079 |
|
19-Apr-2006 |
colm |
Correctly handle internal redirects, by testing only for r-main == NULL.
ap_is_initial_req() returns false for internal redirects. |
e8f95a682820a599fe41b22977010636be5c2717 332306 |
|
10-Nov-2005 |
jim |
No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines |
e17112a66e79c0cc68bae08ca9af5478c9ff0001 161738 |
|
18-Apr-2005 |
pquerna |
- mod_deflate currently only does C-E, and not T-E. Fix the comment at the top saying it does T-E. |
eb9b491d7b262dad572ec2f1f75eea592283f81a 161691 |
|
17-Apr-2005 |
pquerna |
mod_deflate should be merging the Vary header, not Setting it, and ignoring what other modules put there.
Spotted By: Rici Lake |
08cb74ca432a8c24e39f17dedce527e6a47b8001 151408 |
|
04-Feb-2005 |
jerenkrantz |
Update copyright year to 2005 and standardize on current copyright owner line. |
5fa23fda35a1df288264843b9e844582cd655524 109500 |
|
02-Dec-2004 |
jorton |
* 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. |
c7f324e28401dc7cbb6f780a07ba4e5c911d14a7 105410 |
|
12-Oct-2004 |
jorton |
* 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 |
d3b5a5001cb921324e04bafdddd481a10bfbfbd8 105403 |
|
11-Oct-2004 |
pquerna |
Use the ap_is_initial_req() function to test for a subrequest instead of using r->main. |
56fb39c8939e97430d37f044c3f17344a8ed14f8 104352 |
|
23-Jul-2004 |
niq |
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. |
b17faea5d470107abcfa4bc9ae988e8df865a07a 104318 |
|
18-Jul-2004 |
niq |
Tidy up: get rid of dubious cast (nd) and initialise encoding. |
24ba214de3fb95dde637ab0793456da400f412a5 104315 |
|
17-Jul-2004 |
niq |
Fix previous patch to deal correctly with multiple empty brigades before
we know if there's any content, and not re-process the headers. |
06f36a207fac838ea9e7e2e90a3b6d52b64d6061 104314 |
|
17-Jul-2004 |
niq |
Fix headers in deflate_out_filter for the case of an empty first brigade |
5747cfff18153f83b2ac381f81053c7614d208b2 104166 |
|
04-Jul-2004 |
nd |
style |
76d5f4d8e745a77e69d76ff4299f965d485d9346 104155 |
|
03-Jul-2004 |
nd |
that's not really an error condition, so make the message APLOG_DEBUG. |
9ec09ef6dbfa972f35f76905a36b4211b5dda922 104034 |
|
25-Jun-2004 |
niq |
Update inflate_out_filter to support gzip compression flags. |
3ad0f071604de33c0b3733b649cd0445ba00f54d 103910 |
|
11-Jun-2004 |
ake |
Don't deflate responses with zero length e.g. proxied 304's |
0d70304441e932f230e1c8178c03e7aac0faeece 103810 |
|
01-Jun-2004 |
jorton |
* 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 |
504498fd20729dcc29dfbfb78e64a8521c6a767a 103803 |
|
29-May-2004 |
jerenkrantz |
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. |
d4b0232bf7cdf1de7eb1569d6ffb486419646dc3 103476 |
|
22-Apr-2004 |
nd |
content-encoding needs to be unset.
Submitted by: Nick Kew <nick webthing.com> |
3e95d4b000d0b0a94af6a8e10f6888843b0a0f9b 103420 |
|
17-Apr-2004 |
nd |
remove unused variables |
9e8c2603790f490398a0fabf97866b6815748a54 103405 |
|
16-Apr-2004 |
ianh |
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 |
78cd48acd325773619d78ac0d7263a99a8922fae 102618 |
|
09-Feb-2004 |
nd |
fix name of The Apache Software Foundation |
c76539c9b0d46cb6ba80d89a162be09db5095709 102562 |
|
08-Feb-2004 |
nd |
fix copyright dates according to the first checkin |
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dc 102525 |
|
06-Feb-2004 |
nd |
apply Apache License, Version 2.0 |
3096e22e0081a20994549b94453c3b53b2cfc564 102207 |
|
06-Jan-2004 |
ianh |
remove email address in the hopes ppl stop emailing me directly ;( |
26a4456dd6f1a5d7d7fff766551461a578687c4a 102135 |
|
01-Jan-2004 |
nd |
update license to 2004. |
2e7ef6efb7164346000607d5b5c2d2d392d1a5ea 101788 |
|
16-Nov-2003 |
jwoolley |
get rid of _FOREACH |
7a4d24dca91cadf0a71b0356a87d55b9aa973f1d 101019 |
|
19-Aug-2003 |
nd |
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). |
d5f7968a109b466b1baa0ecf89c42b11ac799195 101015 |
|
19-Aug-2003 |
nd |
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 |
d51d001ccc276436f1d031208a063d94a09296e2 100966 |
|
12-Aug-2003 |
stas |
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: |
921777ee81b0509c2aed209e3974e103c395259a 100730 |
|
22-Jul-2003 |
jerenkrantz |
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). |
8c0fccc393de9412bec6bb3ac2802e8bac38716d 99880 |
|
17-May-2003 |
nd |
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> |
ebecc16986604cce1369d5075eff65032e3dd0de 98982 |
|
11-Mar-2003 |
ianh |
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: |
d470ccf962533e14bd6f7265f18840f1397034ee 98948 |
|
08-Mar-2003 |
nd |
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 |
deeff91bef9fb20872eb50bdfa5e9b261a9ce4d1 98895 |
|
05-Mar-2003 |
ianh |
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 |
2de11b5d55c9ffae11582eda6853c5628fccaad1 98689 |
|
17-Feb-2003 |
jerenkrantz |
Fix potential memory leaks in mod_deflate on malformed input data.
PR: 16046 |
33bdcae1f7a1a65e351dda2a766a0cf28b1e695d 98573 |
|
03-Feb-2003 |
nd |
finished that boring job:
update license to 2003.
Happy New Year! ;-)) |
09cb6720f2818cc96229b8cf94c1e0d345875899 98154 |
|
02-Jan-2003 |
nd |
break down macro code and avoid mixed case.
Thanks to Justin for his hints. |
7f0d987aa3c00fb766f606532b82edae38057e69 98149 |
|
01-Jan-2003 |
nd |
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). |
2fa5f4c38890220c6ea439317e7dcb9e8b3c76f7 97526 |
|
14-Nov-2002 |
jwoolley |
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 |
2213cc395cb461faf7bfeb187ebb61d97cd457ef 97473 |
|
10-Nov-2002 |
jerenkrantz |
Always emit Vary header if mod_deflate is involved in the request.
Submitted by: Andr��Malo <nd@perlig.de>
Reviewed by: Justin Erenkrantz |
3d44a5491818189d939116d60f6d8d521ae7fba9 96590 |
|
30-Aug-2002 |
ianh |
actuall fix the bug |
61202a45487668abad788c02e339f626176e645f 96588 |
|
30-Aug-2002 |
ianh |
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> |
b78ed256f4b99e72836d36fd68d4e7a26dbe032c 96318 |
|
07-Aug-2002 |
ianh |
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 |
0fdf8c342123fde84405b885fb1720ebc652e10d 95906 |
|
28-Jun-2002 |
jerenkrantz |
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 |
c4eb619df35bf300829ddcaf01f9faf1f17ae19a 95676 |
|
14-Jun-2002 |
wrowe |
Clean up a signedness emit |
fef8531066947d1dbdb41aa6356e92694e59582a 95666 |
|
14-Jun-2002 |
jerenkrantz |
Modify the deflate input filter so that it should always return data on a
blocking read. |
cb106ddab4352f354ab4fee534f4d1cebe8ded06 95615 |
|
12-Jun-2002 |
wrowe |
An important observations before some x86'er attacks this idea. |
9d39c28bb7a46404d482b64790a9ec0a59dac646 95548 |
|
06-Jun-2002 |
trawick |
get the prototype for strcasecmp() on AIX |
5881036cf52ded2de19b145a459f1dace182a333 95521 |
|
05-Jun-2002 |
jerenkrantz |
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. |
4d911369b8ea69f727251f0856c82b5347a46c74 95413 |
|
31-May-2002 |
jwoolley |
Why the stack buffer and the copy? This seems much more straightforward. |
ff25e04ab08584f9ec9b5f7640a8c5b74d977ff5 95399 |
|
30-May-2002 |
trawick |
keep the signed-ness of char buffers consistent with what is expected
by functions they are passed to (putLong() this time) |
3e5ce93d3ed600c249c1e3e8fc804be8197af548 95397 |
|
30-May-2002 |
jerenkrantz |
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 |
662993c852cc2ccacd29ff1e73f4b4bd24c33cf0 95359 |
|
29-May-2002 |
jerenkrantz |
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 |
555cb68a5d7806f8fc42f8091541a1f7e6866358 95350 |
|
29-May-2002 |
trawick |
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 |
3d95d9e242fd071aefce7f1463c79946de78b4a0 95345 |
|
29-May-2002 |
jerenkrantz |
Input filter support for mod_deflate.
Highly experimental, but known to work for some tests. |
67bc516a48102a726419e1d117a51fcc49800b47 95343 |
|
29-May-2002 |
jerenkrantz |
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.) |
ac79d726fb00764ae5c1ed065ca588d007ffeee6 95341 |
|
29-May-2002 |
jerenkrantz |
Implement flushing support for mod_deflate.
(Review of RFC 1952 indicates that this is indeed easily allowable.) |
207b0826b4b57e8fab686d8dd3f57c235090cbb2 95339 |
|
29-May-2002 |
jerenkrantz |
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 |
a0ac46434497b9c15e6336551d559872ffda0d16 95181 |
|
20-May-2002 |
ianh |
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 |
12901074f5d6b36d08be84d8637b6f2c21e0da26 95151 |
|
17-May-2002 |
trawick |
stop using APLOG_NOERRNO in calls to ap_log_[pr]error() |
f53367106769f90696d9c1f0ffcf9fbb4db883c2 95055 |
|
13-May-2002 |
jerenkrantz |
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 |
cb693382d5c42ee327184b2fafd74bb5bcc5c212 94987 |
|
07-May-2002 |
jerenkrantz |
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. |
688c39f8821b69d305efabd3a4eb5073e2f8d10f 94982 |
|
07-May-2002 |
jerenkrantz |
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). |
ec1719a5748717f67dcd279bb64bd0da424ae450 94979 |
|
07-May-2002 |
jerenkrantz |
Move mod_deflate from experimental to filters to represent our belief
in its stability. |