1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-14 01:22:37 +03:00
Commit Graph

73 Commits

Author SHA1 Message Date
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
Stefan Fritsch
5604942f8f remove unused variables
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992809 13f79535-47bb-0310-9956-ffa450edef68
2010-09-05 15:56:10 +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
Stefan Fritsch
f6af484cea Pass the huge apr_uri_t structs by reference instead of by value
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982012 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 19:39:03 +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
Ruediger Pluem
b82a2f2829 * According to RFC2616 13.2.3 1. negative results of age calculations should
be replaced by zero.

Reported by: Ryujiro Shibuya <rshibuya gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@933886 13f79535-47bb-0310-9956-ffa450edef68
2010-04-14 08:57:18 +00:00
Graham Leggett
a922151440 Style fixes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821539 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 13:24:46 +00:00
Graham Leggett
a2bb3c8022 Remove the server_rec wired into uri_meets_conditions, the debugging
statements that required it were removed in the past, so wiring through
server_rec is no longer necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821538 13f79535-47bb-0310-9956-ffa450edef68
2009-10-04 13:21:25 +00:00
Graham Leggett
050515d99f mod_cache: Fix uri_meets_conditions() so that CacheEnable will
match by scheme, or by a wildcarded hostname.
PR: 40169
Submitted by: Peter Grandi <pg_asf asf.for.sabi.co.uk>
Reviewed by: Graham Leggett


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@821333 13f79535-47bb-0310-9956-ffa450edef68
2009-10-03 14:54:00 +00:00
Graham Leggett
383a108c07 Add suggested parentheses around APR_STATUS_IS_ENOENT.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@809665 13f79535-47bb-0310-9956-ffa450edef68
2009-08-31 17:11:27 +00:00
Guenter Knauf
17d2895c44 moved "finfo.mtime = 0;" after var declaration;
removed tab.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@809440 13f79535-47bb-0310-9956-ffa450edef68
2009-08-31 00:22:44 +00:00
William A. Rowe Jr
23a2ebfd33 Add parenthesis for legibility and correcting association,
and axe an unused variable


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808723 13f79535-47bb-0310-9956-ffa450edef68
2009-08-28 01:31:23 +00:00
Graham Leggett
fd5c214124 Make sure when adding a warning, that we don't duplicate an existing warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808656 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 21:57:27 +00:00
Graham Leggett
2e32dbe9b5 When attempting to set the stale lock, we will pass try_lock twice. If we
already have the lock the first time, we must also have the lock the second
time.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808649 13f79535-47bb-0310-9956-ffa450edef68
2009-08-27 21:44:48 +00:00
Graham Leggett
9bf71872c9 Reintroduce an optimisation lost in some cut and paste. The cache lock
is removed as soon as we see an EOS, or is removed immediately if a
failure has occurred.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808220 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 23:22:18 +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
8433cdfe67 * Correctly save Content-Encoding of cachable entity.
PR: 46401
Submitted by: Dan Poirier <poirier pobox.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726796 13f79535-47bb-0310-9956-ffa450edef68
2008-12-15 20:45:29 +00:00
Ruediger Pluem
6c1424b8d2 * We need to use the headers_out table we merged above, not the original one.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649793 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 10:25:16 +00:00
Ruediger Pluem
bed15a9a7f * Style fixes. No functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649792 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 10:15:14 +00:00
Ruediger Pluem
907b78b12d * Use the correct headers_out table for overlaying.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649791 13f79535-47bb-0310-9956-ffa450edef68
2008-04-19 10:13:34 +00:00
Dirk-Willem van Gulik
b3c481970a Centralize the error-header collapsing done when sending out cached replies. Mark the change in CHANGES as it may have unforseen fall out and/or may need to be reverted or done more subtle.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649460 13f79535-47bb-0310-9956-ffa450edef68
2008-04-18 11:05:25 +00:00