Christophe Jaillet
2c94e2b214
Fix a few warnings on 64 bits windows compilation
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1881304 13f79535-47bb-0310-9956-ffa450edef68
2020-08-29 20:44:03 +00:00
Stefan Eissing
aa885488bc
Addendum to r1856493: check NULLness of new arg parameter.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1859791 13f79535-47bb-0310-9956-ffa450edef68
2019-05-23 14:29:10 +00:00
Yann Ylavic
28064636a7
mod_cache: follow up to r1856493: cache_strqtok() to reject quoted tokens.
...
Use a real state machine to track where quotes are allowed, and for
better clarity too...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1856507 13f79535-47bb-0310-9956-ffa450edef68
2019-03-28 22:39:31 +00:00
Yann Ylavic
f2a066e584
mod_cache: follow up to r1856493: always terminate cache_strqtok() returns.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1856500 13f79535-47bb-0310-9956-ffa450edef68
2019-03-28 18:22:23 +00:00
Yann Ylavic
00bd49eaa5
mod_cache: Fix parsing of quoted Cache-Control token arguments. PR 63288.
...
Make cache_strqtok() return both the token and its unquoted argument (if any),
or an error if the parsing fails.
Cache-Control integer values (max-age, max-stale, ...) can then be parsed w/o
taking care of the (optional) quoting.
Suggested by: fielding
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1856493 13f79535-47bb-0310-9956-ffa450edef68
2019-03-28 16:39:39 +00:00
Yann Ylavic
a920a90838
Axe some redundant conditions. PR 62549.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837941 13f79535-47bb-0310-9956-ffa450edef68
2018-08-13 12:54:30 +00:00
Yann Ylavic
fb5baf3b81
mod_cache: Fix a regression in 2.4.25 for the forward proxy case by
...
computing and using the same entity key according to when the cache
checks, loads and saves the request. PR 60577.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1783842 13f79535-47bb-0310-9956-ffa450edef68
2017-02-21 08:20:45 +00:00
Christophe Jaillet
a309dd8ef3
Remove a useless break + tiny style fix (missing space)
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777557 13f79535-47bb-0310-9956-ffa450edef68
2017-01-06 09:59:32 +00:00
Christophe Jaillet
6976db2d38
Use apr_pstrmemdup instead of apr_pstrndup when applicable
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777556 13f79535-47bb-0310-9956-ffa450edef68
2017-01-06 09:56:53 +00:00
Yann Ylavic
0370f02651
mod_cache: Use the actual URI path and query-string for identifying the
...
cached entity (key), such that rewrites are taken into account when
running afterwards (CacheQuickHandler off). PR 21935.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756553 13f79535-47bb-0310-9956-ffa450edef68
2016-08-16 21:48:09 +00:00
William A. Rowe Jr
f4cc76ee71
Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygen
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
2016-06-09 00:06:42 +00:00
Yann Ylavic
dcb95434f9
Follow up to r1715876: fix typo.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715938 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 20:05:16 +00:00
Yann Ylavic
ae2e62b5b2
mod_cache: Fix (max-stale with no '=') and enforce (check integers after '=')
...
Cache-Control header parsing.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715886 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 17:01:19 +00:00
Yann Ylavic
e30575b0b0
More ap_casecmpstr[n]() usages (follow up to r1715876).
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715880 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:48:35 +00:00
Yann Ylavic
c80e6b2a34
Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715876 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:46:01 +00:00
Yann Ylavic
3c9ddf44bf
Revert r1715789: will re-commit without spurious functional changes.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715869 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:28:36 +00:00
Yann Ylavic
29843dc73f
Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
...
[Reverted by r1715869]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715789 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 12:33:09 +00:00
Edward Lu
938a1c7470
Stop destroying headers when passing through the cache filter
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1704392 13f79535-47bb-0310-9956-ffa450edef68
2015-09-21 19:15:47 +00:00
Eric Covener
f1c62e52e5
use actual error code in AH00779
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1626416 13f79535-47bb-0310-9956-ffa450edef68
2014-09-20 10:59:30 +00:00
Jan Kaluža
2fa69ec094
SECURITY (CVE-2014-3581): Fix a mod_cache NULL pointer deference
...
in Content-Type handling.
mod_cache: Avoid a crash when Content-Type has an empty value. PR56924.
Submitted By: Mark Montague <mark catseye.org>
Reviewed By: Jan Kaluza
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1624234 13f79535-47bb-0310-9956-ffa450edef68
2014-09-11 09:18:38 +00:00
Christophe Jaillet
3a25c513f3
Add missing APLOGNO.
...
Refactor to keep APLOGNO on the same line as ap_log_error, when applicable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1611978 13f79535-47bb-0310-9956-ffa450edef68
2014-07-19 22:02:53 +00:00
Jan Kaluža
66dc61a3f4
mod_cache: try to use the key of a possible open but stale cache entry
...
if we have one in cache_try_lock(). PR 50317
Submitted by: Ruediger Pluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1597533 13f79535-47bb-0310-9956-ffa450edef68
2014-05-26 09:15:44 +00:00
Yann Ylavic
be383e6c93
mod_cache: follow up to r1594643.
...
Avoid table lookup if not necessary (fast path first).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1594648 13f79535-47bb-0310-9956-ffa450edef68
2014-05-14 17:34:05 +00:00
Yann Ylavic
baf4f92af0
mod_cache: follow up to r1591328.
...
Define the cache_merge_headers_out() function to merge r->err_headers_out into
r->headers_out and add the ones from r->content_type/encoding if available.
Use it in ap_cache_cacheable_headers_out() where the same is done and in
cache_save_filter() where this has to be done before updating the entry.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1594643 13f79535-47bb-0310-9956-ffa450edef68
2014-05-14 17:11:49 +00:00
Eric Covener
e31a8d28cb
Fix errors with CacheLock on Windows:
...
cache_util.c(757): (OS 80)The file exists. : [client 127.0.0.1:63889]
AH00784: Attempt to obtain a cache lock for stale cached URL failed,
revalidating entry anyway:
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588704 13f79535-47bb-0310-9956-ffa450edef68
2014-04-19 20:21:01 +00:00
Graham Leggett
0eb8aa4a48
mod_cache: Honour Cache-Control: no-store in a request.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479222 13f79535-47bb-0310-9956-ffa450edef68
2013-05-05 01:12:48 +00:00
Graham Leggett
0ef0994152
mod_cache: Make sure Vary processing handles multivalued Vary headers and
...
multivalued headers referred to via Vary.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478748 13f79535-47bb-0310-9956-ffa450edef68
2013-05-03 12:19:26 +00:00
Graham Leggett
9f68cf2010
mod_cache: Ignore response headers specified by no-cache=header and
...
private=header as specified by RFC2616 14.9.1 What is Cacheable. Ensure
that these headers are still processed when multiple Cache-Control
headers are present in the response. PR 54706
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478382 13f79535-47bb-0310-9956-ffa450edef68
2013-05-02 14:24:26 +00:00
Graham Leggett
6e77e5b20f
mod_cache: Invalidate cached entities in response to RFC2616 Section
...
13.10 Invalidation After Updates or Deletions. PR 15868
Resolves outstanding issue with r1070179 as per
http://www.gossamer-threads.com/lists/apache/dev/395830?do=post_view_threaded#395830
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478140 13f79535-47bb-0310-9956-ffa450edef68
2013-05-01 18:49:04 +00:00
Joe Orton
381ac02df2
* modules/cache/cache_util.c (write_write_order): Remove redundant
...
double assignment, caught by Coverity. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1352534 13f79535-47bb-0310-9956-ffa450edef68
2012-06-21 14:01:57 +00:00
Stefan Fritsch
42c9e0b393
Avoid segfault if url->hostname is NULL and filter->hostname is "*" or ".".
...
Found by clang.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1220467 13f79535-47bb-0310-9956-ffa450edef68
2011-12-18 17:38:24 +00:00
Graham Leggett
26559c25c5
mod_cache: Remove ap_cache_liststr(), it duplicates ap_find_token().
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209798 13f79535-47bb-0310-9956-ffa450edef68
2011-12-03 00:31:53 +00:00
Stefan Fritsch
92e366007c
Add lots of unique tags to error log messages
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Stefan Fritsch
f66af00c19
Avoid some memory allocations by using apr_table_setn where the string
...
arguments are const.
Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 51357
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135083 13f79535-47bb-0310-9956-ffa450edef68
2011-06-13 10:58:10 +00:00
Graham Leggett
e8f8ab7863
mod_cache: Make CacheEnable and CacheDisable configurable per
...
directory in addition to per server, making them work from within
a LocationMatch.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080834 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 01:15:28 +00:00
Graham Leggett
11b28165af
Don't skip the first character, as it may be a quote, which is handled
...
by the walk below.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070699 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14 23:54:14 +00:00
Jeff Trawick
063415fc4a
fix theoretical const issue in call to strchr()
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070627 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14 19:47:31 +00:00
Graham Leggett
bd9b56da19
mod_cache: We must ignore quoted-string values that appear in a
...
Cache-Control header. PR 50199.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070075 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 13:08:57 +00:00
Graham Leggett
dd0370c5e2
mod_cache: Respect s-maxage as described by RFC2616 14.9.3, which must
...
take precedence if present. PR 35247.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1069942 13f79535-47bb-0310-9956-ffa450edef68
2011-02-11 20:12:39 +00:00
Nick Kew
8b659b457c
mod_cache: correctly parse quoted strings in cache headers.
...
PR 50199
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1030299 13f79535-47bb-0310-9956-ffa450edef68
2010-11-03 00:16:47 +00:00
Graham Leggett
27f5e0099b
Be more efficient when handling the Expires header.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023955 13f79535-47bb-0310-9956-ffa450edef68
2010-10-18 19:11:10 +00:00
Graham Leggett
f5d5cd33c5
Use ap_log_rerror() instead of ap_log_error() across mod_cache and
...
mod_disk_cache.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023462 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 11:34:03 +00:00
Graham Leggett
3a3becfa67
Support Cache-Control: no-cache with a header name, and private with a
...
header name, which causes a cached entry to require revalidation (ie
is always not-fresh), as per RFC2616 14.9.1.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023399 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 01:34:04 +00:00
Graham Leggett
7229aa211b
Complete the optimisation of Cache-Control header parsing. Make the
...
cache_control_t structure public so as to be available to mod_disk_cache.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023387 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 23:15:52 +00:00
Graham Leggett
796d4cd074
Begin the process of optimising the parsing of Cache-Control headers. Parse
...
the incoming Cache-Control and Pragma headers once, instead of on each test.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023360 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 19:30:08 +00:00
Graham Leggett
7e03f9e8c0
Remove the attempt to pass the cache key into the lock functions, use
...
cache->key instead for this. Fixes a segfault caused when cache->key
was populated, but the passed in key was not.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1004220 13f79535-47bb-0310-9956-ffa450edef68
2010-10-04 12:46:06 +00:00
Graham Leggett
fe32c3562b
Make cache_provider_list and cache_request_rec private by moving them
...
out of mod_cache.h.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000247 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 21:35:38 +00:00
Graham Leggett
5c7154ed33
Make cache_server_conf, cache_enable and cache_disable private. Remove
...
public prefixes from ap_cache_accept_headers, ap_cache_try_lock and
ap_cache_get_providers.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000211 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 20:44:50 +00:00
Graham Leggett
f427138d29
Remove deprecated ap_cache_cacheable_hdrs_out.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000159 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 19:52:25 +00:00
Graham Leggett
502a305b1d
Remove the MOD_CACHE_REQUEST_REC hack, and pass the cache_request_rec
...
structure through mod_cache's function parameters in the usual way.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000152 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 19:35:26 +00:00