1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-13 21:42:17 +03:00
Commit Graph

825 Commits

Author SHA1 Message Date
Christophe Jaillet
25a2e41ea7 Save a few bytes in conf pool when parsing some directives. Use temp_pool when applicable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1657692 13f79535-47bb-0310-9956-ffa450edef68
2015-02-05 21:03:04 +00:00
Christophe Jaillet
26c1550126 Be consistant with the code below which accepts lower or upper case.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1649632 13f79535-47bb-0310-9956-ffa450edef68
2015-01-05 19:53:35 +00:00
Yann Ylavic
eae7562ac1 mod_reqtimeout: don't extend the timeout in speculative mode, wait for the
real (relevant) bytes to be asked later, within the currently alloted time.
This applies to blocking reads only since r1621453 already bypassed the
filter for nonblocking ones.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1641376 13f79535-47bb-0310-9956-ffa450edef68
2014-11-24 11:42:16 +00:00
Yann Ylavic
b40c9d5167 mod_reqtimeout: revert r1640758.
Unexpected functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640823 13f79535-47bb-0310-9956-ffa450edef68
2014-11-20 21:38:53 +00:00
Yann Ylavic
a952fd276f mod_reqtimeout: avoid unnecessary calls to apr_socket_timeout_set().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1640758 13f79535-47bb-0310-9956-ffa450edef68
2014-11-20 15:39:32 +00:00
Yann Ylavic
0f65768764 mod_buffer: avoid unlikely access to freed memory and forward flushed buckets
immediatly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1632742 13f79535-47bb-0310-9956-ffa450edef68
2014-10-18 08:50:05 +00:00
Rainer Jung
04b2b44708 mod_substitute: No real functional change, but:
- define default for maximum line length
  indepenent of MAX_STRING_LEN
- Clarify line length check with a comment
- add supported 'b' suffix to directive
  description


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1631983 13f79535-47bb-0310-9956-ffa450edef68
2014-10-15 10:02:31 +00:00
Rainer Jung
00b7a3ebf5 mod_substitute: Restrict configuration in .htaccess to
FileInfo as documented.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1628924 13f79535-47bb-0310-9956-ffa450edef68
2014-10-02 10:22:33 +00:00
Rainer Jung
c111e4a45f mod_substitute: Make maximum line length configurable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1628919 13f79535-47bb-0310-9956-ffa450edef68
2014-10-02 09:50:24 +00:00
Rainer Jung
358075baa3 mod_substitute: Fix memory limitation in case of
regexp plus flatten.

The maxlen argument of ap_varbuf_regsub() is unsigned.
Passing in "AP_SUBST_MAX_LINE_LENGTH - vb.strlen"
in case vb.strlen got to big didn't result in the
expected error but instead was handled as a very big
maxlen.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1628104 13f79535-47bb-0310-9956-ffa450edef68
2014-09-28 21:38:33 +00:00
Eric Covener
f41887018a PR56729: mod_reqtimeout gets confused when it sees a read via
check_pipeline() just before a slow HTTP response completes.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1621453 13f79535-47bb-0310-9956-ffa450edef68
2014-08-30 12:59:44 +00:00
Yann Ylavic
2b94587206 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).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1619486 13f79535-47bb-0310-9956-ffa450edef68
2014-08-21 17:02:00 +00:00
Yann Ylavic
681606bbfa 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1619483 13f79535-47bb-0310-9956-ffa450edef68
2014-08-21 16:44:10 +00:00
Yann Ylavic
eb927457cf mod_deflate: follow up to r1619444.
Add missing APLOGNO.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1619453 13f79535-47bb-0310-9956-ffa450edef68
2014-08-21 15:48:36 +00:00
Eric Covener
30939481aa leave a hint while scrolling through inflate() calls
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1619448 13f79535-47bb-0310-9956-ffa450edef68
2014-08-21 15:39:21 +00:00
Yann Ylavic
5cffb8a488 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1619444 13f79535-47bb-0310-9956-ffa450edef68
2014-08-21 15:30:14 +00:00
Eric Covener
18bc74d06e A misplaced check for inflation limits prevented limiting relatively
small inputs.  PR56872

Submitted By: Edward Lu 
Committed By: covener



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1619383 13f79535-47bb-0310-9956-ffa450edef68
2014-08-21 13:11:15 +00:00
Eric Covener
b2e9e97dfb PR56832 -- mod_ratelimit reports at ERROR level everytime a lower-level filter
encounters an error. Since the core output filter only emits TRACE1, a higher
level filter shouldn't log the same condition as ERROR.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1617018 13f79535-47bb-0310-9956-ffa450edef68
2014-08-09 21:20:50 +00:00
Christophe Jaillet
fb0ad3fd89 Turn some APR_BUCKET_REMOVE(e)+apr_bucket_destroy(e) into the equivalent apr_bucket_delete(e) to reduce code verbosity
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1615026 13f79535-47bb-0310-9956-ffa450edef68
2014-08-01 04:23:50 +00:00
Christophe Jaillet
56d0c25725 Add missing APLOGNO.
Refactor some lines to keep APLOGNO on the same line as ap_log_error, when applicable.
Split lines longer than 80.
Improve alignment.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612068 13f79535-47bb-0310-9956-ffa450edef68
2014-07-20 09:32:58 +00:00
Yann Ylavic
5c5e8b71ff mod_deflate: don't require <limits.h> by using APR_INT32_MAX instead of INT_MAX.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611725 13f79535-47bb-0310-9956-ffa450edef68
2014-07-18 17:21:16 +00:00
Christophe Jaillet
66989ec303 Add missing APLOGNO + fix a typo in a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610518 13f79535-47bb-0310-9956-ffa450edef68
2014-07-14 20:44:21 +00:00
Eric Covener
6346ece4d9 *) 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




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1610501 13f79535-47bb-0310-9956-ffa450edef68
2014-07-14 19:56:15 +00:00
Eric Covener
4f6f4c8c02 fix c++/c99 comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1604353 13f79535-47bb-0310-9956-ffa450edef68
2014-06-21 13:15:06 +00:00
Yann Ylavic
5c063de927 mod_sed: Reuse ctx->bb in sed_response_filter() and be safe with its
reentrance. The single return point helps to not duplicate cleanup code.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601877 13f79535-47bb-0310-9956-ffa450edef68
2014-06-11 12:50:29 +00:00
Yann Ylavic
bc39e11342 mod_sed:
Avoid the call to APR_BUCKET_REMOVE() + apr_bucket_delete() on the
same bucket.
Also, empty the input brigade while looping to avoid the trailing
apr_brigade_cleanup() call (no functional change).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601864 13f79535-47bb-0310-9956-ffa450edef68
2014-06-11 11:47:26 +00:00
Yann Ylavic
9614c0b8e6 Strip useless apr_brigade_cleanup() calls.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601624 13f79535-47bb-0310-9956-ffa450edef68
2014-06-10 12:44:15 +00:00
Takashi Sato
79df7ef79e follow up r1599012:
C99 fix


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601559 13f79535-47bb-0310-9956-ffa450edef68
2014-06-10 07:07:36 +00:00
Nick Kew
f0879f7542 mod_proxy_html: support automatic doctype detection.
PR 56285
Patch by Micha Lenk, adapted by niq


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599027 13f79535-47bb-0310-9956-ffa450edef68
2014-06-01 20:05:44 +00:00
Nick Kew
e0cf707e4c mod_proxy_html: skip documents < 4 bytes
PR 56286
Micha Lenk


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1599012 13f79535-47bb-0310-9956-ffa450edef68
2014-06-01 17:33:16 +00:00
Yann Ylavic
6eaa07d635 Rollback r1591302, wrong file commited.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591307 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:21:05 +00:00
Yann Ylavic
f3ec657e4f 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1591302 13f79535-47bb-0310-9956-ffa450edef68
2014-04-30 14:14:53 +00:00
Yann Ylavic
f96bc81bc4 mod_deflate: follow up to r1587639.
Don't break the looped brigade when moving the FLUSH bucket to the returned bb
and continue reading.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1590509 13f79535-47bb-0310-9956-ffa450edef68
2014-04-27 22:39:32 +00:00
Yann Ylavic
b7dc732b76 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).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587639 13f79535-47bb-0310-9956-ffa450edef68
2014-04-15 17:21:45 +00:00
Yann Ylavic
59efbca396 mod_deflate: Delay INFLATE input filter's self removal until all the buffered
buckets are out (including EOS). PR 46146.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587594 13f79535-47bb-0310-9956-ffa450edef68
2014-04-15 14:29:30 +00:00
Yann Ylavic
3ee747a93d mod_deflate: update empty log tags.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1586745 13f79535-47bb-0310-9956-ffa450edef68
2014-04-11 18:59:30 +00:00
Eric Covener
2cd0b69c2d be explicit, for now the 0 val is the default, but it's
a likely candidate for someone to flip later.
 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1586543 13f79535-47bb-0310-9956-ffa450edef68
2014-04-11 02:44:23 +00:00
Eric Covener
0eb1b009f6 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.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1586542 13f79535-47bb-0310-9956-ffa450edef68
2014-04-11 02:42:05 +00:00
Christophe Jaillet
678b982734 Do not perform a p+= 7 that could go past the end of the buffer in case we find a 'content' without a corresponding '='.
Should we need to deal with this case, a new search should be performed to find the real starting position of another potential 'content=' pattern.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1584896 13f79535-47bb-0310-9956-ffa450edef68
2014-04-04 20:30:38 +00:00
Christophe Jaillet
ac219afd63 Do not scan past the end of the buffer.
If no terminating delimiter is found, just leave things as it is

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1584884 13f79535-47bb-0310-9956-ffa450edef68
2014-04-04 20:17:46 +00:00
Christophe Jaillet
a90035fa8d Do not delete the wrong data from HTML code when a "http-equiv" meta tag specifies a Content-Type behind any other "http-equiv" meta tag.
PR 56287 [Micha Lenk <micha lenk info>]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1584878 13f79535-47bb-0310-9956-ffa450edef68
2014-04-04 19:59:06 +00:00
Jeff Trawick
322ae11788 s/comment/self-documenting/
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1583008 13f79535-47bb-0310-9956-ffa450edef68
2014-03-29 14:58:24 +00:00
Eric Covener
575f6bef60 mod_reqtimeout: Resolve unexpected timeouts on keepalive requests
under the Event MPM. PR56216.  

Submitted By: Frank Meier <frank meier ergon ch>
Committed By: covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1580568 13f79535-47bb-0310-9956-ffa450edef68
2014-03-23 18:59:37 +00:00
Yann Ylavic
146a8d0064 mod_deflate: when consuming zlibs flags, APR_INCOMPLETE implies no more bytes available.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1573224 13f79535-47bb-0310-9956-ffa450edef68
2014-03-01 20:34:55 +00:00
Yann Ylavic
bd82e79001 mod_deflate: follows up r1572896.
Be safe from successive or post end-of-stream flush buckets.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572911 13f79535-47bb-0310-9956-ffa450edef68
2014-02-28 10:42:47 +00:00
Yann Ylavic
6175046246 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572896 13f79535-47bb-0310-9956-ffa450edef68
2014-02-28 09:42:41 +00:00
Yann Ylavic
a65687806d 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572671 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 18:15:03 +00:00
Yann Ylavic
a915ff1f64 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().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572670 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 18:08:34 +00:00
Yann Ylavic
e3171b7fa6 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).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572669 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 18:01:38 +00:00
Yann Ylavic
50c0de8c98 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1572668 13f79535-47bb-0310-9956-ffa450edef68
2014-02-27 17:57:13 +00:00