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
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
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
Christophe Jaillet
68131d85a4
Fix some style issues on files that can easily be synch'ed with 2.4.x
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705983 13f79535-47bb-0310-9956-ffa450edef68
2015-09-30 08:35:35 +00:00
Christophe Jaillet
1b6e2b3ebf
s/apr_pstrndup/apr_pstrmemdup/ when applicable
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1563381 13f79535-47bb-0310-9956-ffa450edef68
2014-02-01 08:26:33 +00:00
Graham Leggett
e62246ac2b
SECURITY (CVE-2013-4352): Fix a NULL pointer deference which allowed
...
untrusted origin servers to crash mod_cache in a forward proxy configuration.
mod_cache: Avoid a crash with strcmp() when the hostname is not provided.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1523235 13f79535-47bb-0310-9956-ffa450edef68
2013-09-14 13:32:25 +00:00
Jeff Trawick
7e7f76f56c
const goodness with nasty strrchr and strchr functions
...
(resolve warning in maintainer mode)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1491564 13f79535-47bb-0310-9956-ffa450edef68
2013-06-10 18:43:45 +00:00
Graham Leggett
5c93801e65
Ensure that Warning headers are correctly handled as per RFC2616.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1480283 13f79535-47bb-0310-9956-ffa450edef68
2013-05-08 14:06:48 +00:00
Graham Leggett
6194962c46
core, mod_cache: Ensure RFC2616 compliance in ap_meets_conditions()
...
with weak validation combined with If-Range and Range headers. Break
out explicit conditional header checks to be useable elsewhere in the
server. Ensure weak validation RFC compliance in the byteranges filter.
Ensure RFC validation compliance when serving cached entities. PR 16142
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1479905 13f79535-47bb-0310-9956-ffa450edef68
2013-05-07 13:42:31 +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
Guenter Knauf
99a323a122
Silent no-prototype compiler warning.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478798 13f79535-47bb-0310-9956-ffa450edef68
2013-05-03 14:05:01 +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
f18afbfba1
mod_cache: When serving from cache, only the last header of a multivalued
...
header was taken into account. Fixed.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478441 13f79535-47bb-0310-9956-ffa450edef68
2013-05-02 16:51:27 +00:00
Graham Leggett
d32086bb4c
Apply log message tags to messages.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1478173 13f79535-47bb-0310-9956-ffa450edef68
2013-05-01 20:06:57 +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
Christophe Jaillet
523996f1f6
cache_storage: remove useless test + update function name in debug log + skip as soon as we know headers do not match
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1452281 13f79535-47bb-0310-9956-ffa450edef68
2013-03-04 13:02:09 +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
Graham Leggett
43fc2d47c7
mod_cache: When a request other than GET or HEAD arrives, we must
...
invalidate existing cache entities as per RFC2616 13.10. PR 15868.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070179 13f79535-47bb-0310-9956-ffa450edef68
2011-02-13 02:03:29 +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
c7194e2e36
Don't attempt to kill a stale entry that cannot be revalidated so early
...
in the process, as this will happen later anyway as necessary. We may want
to serve the stale entry should the backend not be available.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023398 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 01:24:24 +00:00
Graham Leggett
3b619648dc
Don't attempt to remove the existing conditional headers until we have
...
committed to adding our own.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023396 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:50:28 +00:00
Graham Leggett
7ce9abf618
Support Cache-Control: only-if-cached, as per RFC2616 14.9.4.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023394 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:20:41 +00:00
Graham Leggett
fc7955190f
Fix the error cases in the cache_select() loop. On error we must loop around
...
to the next provider, not return DECLINED too early, except for the
revalidate case, where returning DECLINED is correct behaviour.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023392 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 00:01:45 +00:00
Graham Leggett
44584f6a5a
Fix the return values in the cache_select() function, we don't return APR
...
error codes in this case.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023390 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 23:42:25 +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
38d82baaae
mod_cache: Don't regenerate the cache key if we have already generated it.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1004373 13f79535-47bb-0310-9956-ffa450edef68
2010-10-04 19:27:22 +00:00
Graham Leggett
d29eacb478
mod_cache: Allow control over the base URL of reverse proxied requests
...
using the CacheKeyBaseURL directive, so that the cache key can be
calculated from the endpoint URL instead of the server URL.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003963 13f79535-47bb-0310-9956-ffa450edef68
2010-10-03 13:23:39 +00:00
Graham Leggett
46a24e84f8
Remove a relic from the original error code, and fix segfaults in the
...
process.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000395 13f79535-47bb-0310-9956-ffa450edef68
2010-09-23 10:17:07 +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
8a91dc4dbe
Make ap_cache_accept_headers, ap_cache_accept_headers, ap_cache_try_lock and
...
ap_cache_check_freshness private.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000187 13f79535-47bb-0310-9956-ffa450edef68
2010-09-22 20:28:11 +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
Graham Leggett
c8de96f357
Move private cache_* declarations out of the public mod_cache.h file.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999681 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 22:55:22 +00:00
Graham Leggett
d8fc5d96a8
mod_cache: Give the cache provider the opportunity to choose to cache
...
or not cache based on the buckets present in the brigade, such as the
presence of a FILE bucket.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@999630 13f79535-47bb-0310-9956-ffa450edef68
2010-09-21 20:43:44 +00:00
Graham Leggett
c3084aa4de
mod_cache: Check the request to determine whether we are allowed
...
to return cached content at all, and respect a "Cache-Control:
no-cache" header from a client. Previously, "no-cache" would
behave like "max-age=0".
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992625 13f79535-47bb-0310-9956-ffa450edef68
2010-09-04 15:20:30 +00:00
Graham Leggett
8991d4795f
mod_cache: Use a proper filter context to hold filter data instead
...
of misusing the per-request configuration. Fixes a segfault on trunk
when the normal handler is used.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992614 13f79535-47bb-0310-9956-ffa450edef68
2010-09-04 14:42:30 +00:00
Paul Querna
ad53d4dcbd
CVE-2010-1452: Fix handling of missing path segments in the parsed URI structure.
...
If a specially crafted request was sent, it is possible to crash mod_dav,
mod_cache or mod_session, as they accessed a field that is set to NULL
by the URI parser, assuming that it always put in a valid string.
PR: 49246
Submitted by: Mark Drayton
Patch by: Jeff Trawick
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@966348 13f79535-47bb-0310-9956-ffa450edef68
2010-07-21 18:25:01 +00:00
Stefan Fritsch
ebb62867fb
Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
...
advantage of per-module loglevels
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Stefan Fritsch
2173f71a93
Allow several of the configured session identifiers to be found and removed in
...
a single request.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@897705 13f79535-47bb-0310-9956-ffa450edef68
2010-01-10 21:07:26 +00:00
Ruediger Pluem
8a66869e0c
* Do an exact match of the keys defined by CacheIgnoreURLSessionIdentifiers
...
against the querystring instead of a partial match.
PR: 48401
Submitted by: Dodou Wang <wangdong.08 gmail.com>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@892289 13f79535-47bb-0310-9956-ffa450edef68
2009-12-18 16:03:13 +00:00
Graham Leggett
2c379cc6fb
mod_cache: Introduce the thundering herd lock, a mechanism to keep
...
the flood of requests at bay that strike a backend webserver as
a cached entity goes stale.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808212 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 22:46:35 +00:00
Ruediger Pluem
023b0a4f61
* Correctly detect if CacheIgnoreURLSessionIdentifiers is set.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@778439 13f79535-47bb-0310-9956-ffa450edef68
2009-05-25 15:24:47 +00:00
Ruediger Pluem
d2700640cd
* Add CacheIgnoreURLSessionIdentifiers directive to ignore
...
defined session identifiers encoded in the URL when caching.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@777042 13f79535-47bb-0310-9956-ffa450edef68
2009-05-21 10:42:54 +00:00
Paul Querna
a324a1d72f
Remove all references to CORE_PRIVATE.
...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
Ruediger Pluem
1fb72c6dd2
* Do not do Range requests if we use our own conditionals for validating
...
a cache entity: If we get 304 the Range does not matter and otherwise the
entity changed and we want to have the complete entity.
PR: 44579
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@636653 13f79535-47bb-0310-9956-ffa450edef68
2008-03-13 07:28:40 +00:00
Ruediger Pluem
477744b538
* Save the key we generate during our first run of cache_generate_key_default
...
on each request in the request_config. During consecutive runs of
cache_generate_key_default during processing the request we restore it
from there as we might not be able to generate the same key again as
the ingredients used to compose the key might have changed and we constantly
must use a key that could be generated during the quick handler phase.
PR: 41475
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@506621 13f79535-47bb-0310-9956-ffa450edef68
2007-02-12 20:29:04 +00:00
Ruediger Pluem
8a7fb4574c
* Add CacheIgnoreQueryString directive to cache requests with a query string
...
even if no expiration time is specified. Futhermore the query string will not
be used for key generation such that requests to the same URI path, but with
different query strings are mapped to the same cache entity. Turning this
setting to ON violates RFC 2616/13.9 and thus it is turned off by default.
PR: 41484
Submitted by: Fredrik Widlund <fredrik.widlund qbrick.com>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@504183 13f79535-47bb-0310-9956-ffa450edef68
2007-02-06 15:55:50 +00:00
Ruediger Pluem
7410019c69
* Remove expired content from cache that cannot be revalidated.
...
PR: 30370
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@481886 13f79535-47bb-0310-9956-ffa450edef68
2006-12-03 20:51:13 +00:00
Ruediger Pluem
e6a844c031
* Use the query string stored in r->parsed_uri.query instead of r->args
...
as r->args could have been changed (e.g. via mod_rewrite) after the quick
handler hook. This causes resources to be stored under a key, where they
cannot be fetched again in the quick handler.
PR: 40805
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@476625 13f79535-47bb-0310-9956-ffa450edef68
2006-11-18 22:17:33 +00:00